Skip to content

Commit dc5423a

Browse files
committed
Auto merge of #8534 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
2 parents e2e492c + 2ebd0b2 commit dc5423a

Some content is hidden

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

66 files changed

+194
-186
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ rustc-workspace-hack = "1.0"
4343
clippy_utils = { path = "clippy_utils" }
4444
derive-new = "0.5"
4545
if_chain = "1.0"
46-
itertools = "0.10"
46+
itertools = "0.10.1"
4747
quote = "1.0"
4848
serde = { version = "1.0", features = ["derive"] }
4949
syn = { version = "1.0", features = ["full"] }

clippy_dev/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77
bytecount = "0.6"
88
clap = "2.33"
99
indoc = "1.0"
10-
itertools = "0.10"
10+
itertools = "0.10.1"
1111
opener = "0.5"
1212
regex = "1.5"
1313
shell-escape = "0.1"

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ edition = "2021"
1212
cargo_metadata = "0.14"
1313
clippy_utils = { path = "../clippy_utils" }
1414
if_chain = "1.0"
15-
itertools = "0.10"
15+
itertools = "0.10.1"
1616
pulldown-cmark = { version = "0.9", default-features = false }
1717
quine-mc_cluskey = "0.2"
1818
regex-syntax = "0.6"

clippy_lints/src/await_holding_invalid.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl LateLintPass<'_> for AwaitHolding {
149149
fn check_interior_types(cx: &LateContext<'_>, ty_causes: &[GeneratorInteriorTypeCause<'_>], span: Span) {
150150
for ty_cause in ty_causes {
151151
if let rustc_middle::ty::Adt(adt, _) = ty_cause.ty.kind() {
152-
if is_mutex_guard(cx, adt.did) {
152+
if is_mutex_guard(cx, adt.did()) {
153153
span_lint_and_then(
154154
cx,
155155
AWAIT_HOLDING_LOCK,
@@ -167,7 +167,7 @@ fn check_interior_types(cx: &LateContext<'_>, ty_causes: &[GeneratorInteriorType
167167
},
168168
);
169169
}
170-
if is_refcell_ref(cx, adt.did) {
170+
if is_refcell_ref(cx, adt.did()) {
171171
span_lint_and_then(
172172
cx,
173173
AWAIT_HOLDING_REFCELL_REF,

clippy_lints/src/case_sensitive_file_extension_comparisons.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use clippy_utils::diagnostics::span_lint_and_help;
22
use if_chain::if_chain;
33
use rustc_ast::ast::LitKind;
4+
use rustc_data_structures::intern::Interned;
45
use rustc_hir::{Expr, ExprKind, PathSegment};
56
use rustc_lint::{LateContext, LateLintPass};
67
use rustc_middle::ty;
@@ -55,7 +56,7 @@ fn check_case_sensitive_file_extension_comparison(ctx: &LateContext<'_>, expr: &
5556
ty::Str => {
5657
return Some(span);
5758
},
58-
ty::Adt(&ty::AdtDef { did, .. }, _) => {
59+
ty::Adt(ty::AdtDef(Interned(&ty::AdtDefData { did, .. }, _)), _) => {
5960
if ctx.tcx.is_diagnostic_item(sym::String, did) {
6061
return Some(span);
6162
}

clippy_lints/src/casts/cast_possible_truncation.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_expr: &Expr<'_>,
116116
&& let Res::Def(DefKind::Ctor(..), id) = cx.qpath_res(p, cast_expr.hir_id)
117117
{
118118
let i = def.variant_index_with_ctor_id(id);
119-
let variant = &def.variants[i];
120-
let nbits = utils::enum_value_nbits(get_discriminant_value(cx.tcx, def, i));
119+
let variant = def.variant(i);
120+
let nbits = utils::enum_value_nbits(get_discriminant_value(cx.tcx, *def, i));
121121
(nbits, Some(variant))
122122
} else {
123-
(utils::enum_ty_to_nbits(def, cx.tcx), None)
123+
(utils::enum_ty_to_nbits(*def, cx.tcx), None)
124124
};
125125
let to_nbits = utils::int_ty_to_nbits(cast_to, cx.tcx);
126126

127-
let cast_from_ptr_size = def.repr.int.map_or(true, |ty| {
127+
let cast_from_ptr_size = def.repr().int.map_or(true, |ty| {
128128
matches!(
129129
ty,
130130
IntType::SignedInt(ast::IntTy::Isize) | IntType::UnsignedInt(ast::UintTy::Usize)

clippy_lints/src/casts/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ pub(super) fn enum_value_nbits(value: EnumValue) -> u64 {
3434
.into()
3535
}
3636

37-
pub(super) fn enum_ty_to_nbits(adt: &AdtDef, tcx: TyCtxt<'_>) -> u64 {
37+
pub(super) fn enum_ty_to_nbits(adt: AdtDef<'_>, tcx: TyCtxt<'_>) -> u64 {
3838
let mut explicit = 0i128;
3939
let (start, end) = adt
40-
.variants
40+
.variants()
4141
.iter()
4242
.fold((0, i128::MIN), |(start, end), variant| match variant.discr {
4343
VariantDiscr::Relative(x) => match explicit.checked_add(i128::from(x)) {

clippy_lints/src/copies.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use clippy_utils::{
66
};
77
use if_chain::if_chain;
88
use rustc_data_structures::fx::FxHashSet;
9-
use rustc_errors::{Applicability, DiagnosticBuilder};
9+
use rustc_errors::{Applicability, Diagnostic};
1010
use rustc_hir::intravisit::{self, Visitor};
1111
use rustc_hir::{Block, Expr, ExprKind, HirId};
1212
use rustc_lint::{LateContext, LateLintPass, LintContext};
@@ -489,7 +489,7 @@ fn emit_branches_sharing_code_lint(
489489
add_expr_note = !cx.typeck_results().expr_ty(if_expr).is_unit();
490490
}
491491

492-
let add_optional_msgs = |diag: &mut DiagnosticBuilder<'_>| {
492+
let add_optional_msgs = |diag: &mut Diagnostic| {
493493
if add_expr_note {
494494
diag.note("The end suggestion probably needs some adjustments to use the expression result correctly");
495495
}

clippy_lints/src/default.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl<'tcx> LateLintPass<'tcx> for Default {
9696
then {
9797
// TODO: Work out a way to put "whatever the imported way of referencing
9898
// this type in this file" rather than a fully-qualified type.
99-
let replacement = format!("{}::default()", cx.tcx.def_path_str(def.did));
99+
let replacement = format!("{}::default()", cx.tcx.def_path_str(def.did()));
100100
span_lint_and_sugg(
101101
cx,
102102
DEFAULT_TRAIT_ACCESS,
@@ -137,7 +137,7 @@ impl<'tcx> LateLintPass<'tcx> for Default {
137137
if let Some(adt) = binding_type.ty_adt_def();
138138
if adt.is_struct();
139139
let variant = adt.non_enum_variant();
140-
if adt.did.is_local() || !variant.is_field_list_non_exhaustive();
140+
if adt.did().is_local() || !variant.is_field_list_non_exhaustive();
141141
let module_did = cx.tcx.parent_module(stmt.hir_id).to_def_id();
142142
if variant
143143
.fields
@@ -216,7 +216,7 @@ impl<'tcx> LateLintPass<'tcx> for Default {
216216
if let ty::Adt(adt_def, substs) = binding_type.kind();
217217
if !substs.is_empty();
218218
then {
219-
let adt_def_ty_name = cx.tcx.item_name(adt_def.did);
219+
let adt_def_ty_name = cx.tcx.item_name(adt_def.did());
220220
let generic_args = substs.iter().collect::<Vec<_>>();
221221
let tys_str = generic_args
222222
.iter()

clippy_lints/src/default_numeric_fallback.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NumericFallbackVisitor<'a, 'tcx> {
148148
if_chain! {
149149
if let Some(adt_def) = ty.ty_adt_def();
150150
if adt_def.is_struct();
151-
if let Some(variant) = adt_def.variants.iter().next();
151+
if let Some(variant) = adt_def.variants().iter().next();
152152
then {
153153
let fields_def = &variant.fields;
154154

0 commit comments

Comments
 (0)