Skip to content

Commit 149392b

Browse files
committed
Auto merge of rust-lang#10402 - Jarcho:rustup, r=Jarcho
Rustup Looks like `@flip1995` is busy. r? `@ghost` changelog: None
2 parents 5155119 + 69c4ff6 commit 149392b

File tree

84 files changed

+186
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+186
-155
lines changed

clippy_lints/src/casts/cast_ptr_alignment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn is_used_as_unaligned(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
6666
if matches!(name.ident.as_str(), "read_unaligned" | "write_unaligned")
6767
&& let Some(def_id) = cx.typeck_results().type_dependent_def_id(parent.hir_id)
6868
&& let Some(def_id) = cx.tcx.impl_of_method(def_id)
69-
&& cx.tcx.type_of(def_id).is_unsafe_ptr()
69+
&& cx.tcx.type_of(def_id).subst_identity().is_unsafe_ptr()
7070
{
7171
true
7272
} else {

clippy_lints/src/copy_iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl<'tcx> LateLintPass<'tcx> for CopyIterator {
4343
of_trait: Some(ref trait_ref),
4444
..
4545
}) = item.kind;
46-
let ty = cx.tcx.type_of(item.owner_id);
46+
let ty = cx.tcx.type_of(item.owner_id).subst_identity();
4747
if is_copy(cx, ty);
4848
if let Some(trait_id) = trait_ref.trait_def_id();
4949
if cx.tcx.is_diagnostic_item(sym::Iterator, trait_id);

clippy_lints/src/default.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl<'tcx> LateLintPass<'tcx> for Default {
150150
.fields
151151
.iter()
152152
.all(|field| {
153-
is_copy(cx, cx.tcx.type_of(field.did))
153+
is_copy(cx, cx.tcx.type_of(field.did).subst_identity())
154154
});
155155
if !has_drop(cx, binding_type) || all_fields_are_copy;
156156
then {

clippy_lints/src/default_numeric_fallback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NumericFallbackVisitor<'a, 'tcx> {
167167
.iter()
168168
.find_map(|f_def| {
169169
if f_def.ident(self.cx.tcx) == field.ident
170-
{ Some(self.cx.tcx.type_of(f_def.did)) }
170+
{ Some(self.cx.tcx.type_of(f_def.did).subst_identity()) }
171171
else { None }
172172
});
173173
self.ty_bounds.push(bound.into());

clippy_lints/src/dereference.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use rustc_middle::mir::{Rvalue, StatementKind};
2727
use rustc_middle::ty::adjustment::{Adjust, Adjustment, AutoBorrow, AutoBorrowMutability};
2828
use rustc_middle::ty::{
2929
self, Binder, BoundVariableKind, Clause, EarlyBinder, FnSig, GenericArgKind, List, ParamEnv, ParamTy,
30-
PredicateKind, ProjectionPredicate, Ty, TyCtxt, TypeVisitable, TypeckResults,
30+
PredicateKind, ProjectionPredicate, Ty, TyCtxt, TypeVisitableExt, TypeckResults,
3131
};
3232
use rustc_session::{declare_tool_lint, impl_lint_pass};
3333
use rustc_span::{symbol::sym, Span, Symbol};
@@ -735,7 +735,7 @@ fn walk_parents<'tcx>(
735735
span,
736736
..
737737
}) if span.ctxt() == ctxt => {
738-
let ty = cx.tcx.type_of(owner_id.def_id);
738+
let ty = cx.tcx.type_of(owner_id.def_id).subst_identity();
739739
Some(ty_auto_deref_stability(cx.tcx, cx.param_env, ty, precedence).position_for_result(cx))
740740
},
741741

@@ -781,7 +781,7 @@ fn walk_parents<'tcx>(
781781
cx.tcx,
782782
// Use the param_env of the target type.
783783
cx.tcx.param_env(adt.did()),
784-
cx.tcx.type_of(field_def.did),
784+
cx.tcx.type_of(field_def.did).subst_identity(),
785785
precedence,
786786
)
787787
.position_for_arg()

clippy_lints/src/derivable_impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
184184
if let Some(Node::ImplItem(impl_item)) = cx.tcx.hir().find(impl_item_hir);
185185
if let ImplItemKind::Fn(_, b) = &impl_item.kind;
186186
if let Body { value: func_expr, .. } = cx.tcx.hir().body(*b);
187-
if let Some(adt_def) = cx.tcx.type_of(item.owner_id).ty_adt_def();
187+
if let Some(adt_def) = cx.tcx.type_of(item.owner_id).subst_identity().ty_adt_def();
188188
if let attrs = cx.tcx.hir().attrs(item.hir_id());
189189
if !attrs.iter().any(|attr| attr.doc_str().is_some());
190190
if let child_attrs = cx.tcx.hir().attrs(impl_item_hir);

clippy_lints/src/derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl<'tcx> LateLintPass<'tcx> for Derive {
211211
..
212212
}) = item.kind
213213
{
214-
let ty = cx.tcx.type_of(item.owner_id);
214+
let ty = cx.tcx.type_of(item.owner_id).subst_identity();
215215
let is_automatically_derived = cx.tcx.has_attr(item.owner_id.to_def_id(), sym::automatically_derived);
216216

217217
check_hash_peq(cx, item.span, trait_ref, ty, is_automatically_derived);
@@ -347,7 +347,7 @@ fn check_copy_clone<'tcx>(cx: &LateContext<'tcx>, item: &Item<'_>, trait_ref: &h
347347
let has_copy_impl = cx.tcx.all_local_trait_impls(()).get(&copy_id).map_or(false, |impls| {
348348
impls
349349
.iter()
350-
.any(|&id| matches!(cx.tcx.type_of(id).kind(), ty::Adt(adt, _) if ty_adt.did() == adt.did()))
350+
.any(|&id| matches!(cx.tcx.type_of(id).subst_identity().kind(), ty::Adt(adt, _) if ty_adt.did() == adt.did()))
351351
});
352352
if !has_copy_impl {
353353
return;

clippy_lints/src/doc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use rustc_ast::token::CommentKind;
1616
use rustc_data_structures::fx::FxHashSet;
1717
use rustc_data_structures::sync::Lrc;
1818
use rustc_errors::emitter::EmitterWriter;
19-
use rustc_errors::{Applicability, Handler, SuggestionStyle};
19+
use rustc_errors::{Applicability, Handler, SuggestionStyle, TerminalUrl};
2020
use rustc_hir as hir;
2121
use rustc_hir::intravisit::{self, Visitor};
2222
use rustc_hir::{AnonConst, Expr};
@@ -707,7 +707,7 @@ fn check_code(cx: &LateContext<'_>, text: &str, edition: Edition, span: Span) {
707707

708708
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
709709
let fallback_bundle =
710-
rustc_errors::fallback_fluent_bundle(rustc_errors::DEFAULT_LOCALE_RESOURCES, false);
710+
rustc_errors::fallback_fluent_bundle(rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), false);
711711
let emitter = EmitterWriter::new(
712712
Box::new(io::sink()),
713713
None,
@@ -719,6 +719,7 @@ fn check_code(cx: &LateContext<'_>, text: &str, edition: Edition, span: Span) {
719719
None,
720720
false,
721721
false,
722+
TerminalUrl::No,
722723
);
723724
let handler = Handler::with_emitter(false, None, Box::new(emitter));
724725
let sess = ParseSess::with_span_handler(handler, sm);

clippy_lints/src/empty_enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<'tcx> LateLintPass<'tcx> for EmptyEnum {
4949
}
5050

5151
if let ItemKind::Enum(..) = item.kind {
52-
let ty = cx.tcx.type_of(item.owner_id);
52+
let ty = cx.tcx.type_of(item.owner_id).subst_identity();
5353
let adt = ty.ty_adt_def().expect("already checked whether this is an enum");
5454
if adt.variants().is_empty() {
5555
span_lint_and_help(

clippy_lints/src/enum_clike.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<'tcx> LateLintPass<'tcx> for UnportableVariant {
4545
for var in def.variants {
4646
if let Some(anon_const) = &var.disr_expr {
4747
let def_id = cx.tcx.hir().body_owner_def_id(anon_const.body);
48-
let mut ty = cx.tcx.type_of(def_id.to_def_id());
48+
let mut ty = cx.tcx.type_of(def_id.to_def_id()).subst_identity();
4949
let constant = cx
5050
.tcx
5151
.const_eval_poly(def_id.to_def_id())

0 commit comments

Comments
 (0)