Skip to content

Commit 4ef7529

Browse files
authored
Rustup (#15044)
r? @ghost changelog: none
2 parents 6662aed + 19c2f03 commit 4ef7529

Some content is hidden

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

53 files changed

+128
-116
lines changed

clippy_lints/src/arbitrary_source_item_ordering.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
272272
return;
273273
}
274274
match &item.kind {
275-
ItemKind::Enum(_, enum_def, _generics) if self.enable_ordering_for_enum => {
275+
ItemKind::Enum(_, _generics, enum_def) if self.enable_ordering_for_enum => {
276276
let mut cur_v: Option<&Variant<'_>> = None;
277277
for variant in enum_def.variants {
278278
if variant.span.in_external_macro(cx.sess().source_map()) {
@@ -288,7 +288,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
288288
cur_v = Some(variant);
289289
}
290290
},
291-
ItemKind::Struct(_, VariantData::Struct { fields, .. }, _generics) if self.enable_ordering_for_struct => {
291+
ItemKind::Struct(_, _generics, VariantData::Struct { fields, .. }) if self.enable_ordering_for_struct => {
292292
let mut cur_f: Option<&FieldDef<'_>> = None;
293293
for field in *fields {
294294
if field.span.in_external_macro(cx.sess().source_map()) {

clippy_lints/src/disallowed_types.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ impl_lint_pass!(DisallowedTypes => [DISALLOWED_TYPES]);
105105

106106
impl<'tcx> LateLintPass<'tcx> for DisallowedTypes {
107107
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
108-
if let ItemKind::Use(path, UseKind::Single(_)) = &item.kind {
109-
for res in &path.res {
110-
self.check_res_emit(cx, res, item.span);
111-
}
108+
if let ItemKind::Use(path, UseKind::Single(_)) = &item.kind
109+
&& let Some(res) = path.res.type_ns
110+
{
111+
self.check_res_emit(cx, &res, item.span);
112112
}
113113
}
114114

clippy_lints/src/empty_with_brackets.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl_lint_pass!(EmptyWithBrackets => [EMPTY_STRUCTS_WITH_BRACKETS, EMPTY_ENUM_VA
9292

9393
impl LateLintPass<'_> for EmptyWithBrackets {
9494
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
95-
if let ItemKind::Struct(ident, var_data, _) = &item.kind
95+
if let ItemKind::Struct(ident, _, var_data) = &item.kind
9696
&& !item.span.from_expansion()
9797
&& has_brackets(var_data)
9898
&& let span_after_ident = item.span.with_lo(ident.span.hi())

clippy_lints/src/enum_clike.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl<'tcx> LateLintPass<'tcx> for UnportableVariant {
3838
if cx.tcx.data_layout.pointer_size.bits() != 64 {
3939
return;
4040
}
41-
if let ItemKind::Enum(_, def, _) = &item.kind {
41+
if let ItemKind::Enum(_, _, def) = &item.kind {
4242
for var in def.variants {
4343
if let Some(anon_const) = &var.disr_expr {
4444
let def_id = cx.tcx.hir_body_owner_def_id(anon_const.body);

clippy_lints/src/excessive_bools.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn check_fn_decl(cx: &LateContext<'_>, decl: &FnDecl<'_>, sp: Span, max: u64) {
127127

128128
impl<'tcx> LateLintPass<'tcx> for ExcessiveBools {
129129
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
130-
if let ItemKind::Struct(_, variant_data, _) = &item.kind
130+
if let ItemKind::Struct(_, _, variant_data) = &item.kind
131131
&& variant_data.fields().len() as u64 > self.max_struct_bools
132132
&& has_n_bools(
133133
variant_data.fields().iter().map(|field| field.ty),

clippy_lints/src/exhaustive_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl LateLintPass<'_> for ExhaustiveItems {
7676
"exported enums should not be exhaustive",
7777
[].as_slice(),
7878
),
79-
ItemKind::Struct(_, v, ..) => (
79+
ItemKind::Struct(_, _, v) => (
8080
EXHAUSTIVE_STRUCTS,
8181
"exported structs should not be exhaustive",
8282
v.fields(),

clippy_lints/src/functions/result.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fn check_result_large_err<'tcx>(cx: &LateContext<'tcx>, err_ty: Ty<'tcx>, hir_ty
103103
.did()
104104
.as_local()
105105
&& let hir::Node::Item(item) = cx.tcx.hir_node_by_def_id(local_def_id)
106-
&& let hir::ItemKind::Enum(_, ref def, _) = item.kind
106+
&& let hir::ItemKind::Enum(_, _, ref def) = item.kind
107107
{
108108
let variants_size = AdtVariantInfo::new(cx, *adt, subst);
109109
if let Some((first_variant, variants)) = variants_size.split_first()

clippy_lints/src/item_name_repetitions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,10 @@ impl LateLintPass<'_> for ItemNameRepetitions {
535535

536536
if span_is_local(item.span) {
537537
match item.kind {
538-
ItemKind::Enum(_, def, _) => {
538+
ItemKind::Enum(_, _, def) => {
539539
self.check_variants(cx, item, &def);
540540
},
541-
ItemKind::Struct(_, VariantData::Struct { fields, .. }, _) => {
541+
ItemKind::Struct(_, _, VariantData::Struct { fields, .. }) => {
542542
self.check_fields(cx, item, fields);
543543
},
544544
_ => (),

clippy_lints/src/large_const_arrays.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl_lint_pass!(LargeConstArrays => [LARGE_CONST_ARRAYS]);
4848

4949
impl<'tcx> LateLintPass<'tcx> for LargeConstArrays {
5050
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
51-
if let ItemKind::Const(ident, _, generics, _) = &item.kind
51+
if let ItemKind::Const(ident, generics, _, _) = &item.kind
5252
// Since static items may not have generics, skip generic const items.
5353
// FIXME(generic_const_items): I don't think checking `generics.hwcp` suffices as it
5454
// doesn't account for empty where-clauses that only consist of keyword `where` IINM.

clippy_lints/src/large_enum_variant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl_lint_pass!(LargeEnumVariant => [LARGE_ENUM_VARIANT]);
7373

7474
impl<'tcx> LateLintPass<'tcx> for LargeEnumVariant {
7575
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &Item<'tcx>) {
76-
if let ItemKind::Enum(ident, ref def, _) = item.kind
76+
if let ItemKind::Enum(ident, _, ref def) = item.kind
7777
&& let ty = cx.tcx.type_of(item.owner_id).instantiate_identity()
7878
&& let ty::Adt(adt, subst) = ty.kind()
7979
&& adt.variants().len() > 1

0 commit comments

Comments
 (0)