Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiple expect attribs in impl block #114417

Rate limit · GitHub

Whoa there!

You have triggered an abuse detection mechanism.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix formatting
Rate limit · GitHub

Whoa there!

You have triggered an abuse detection mechanism.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

chinedufn committed Sep 12, 2023
commit feb80025023a7cade71003309ae0806bda82f251
20 changes: 8 additions & 12 deletions compiler/rustc_passes/src/dead.rs
Original file line number Diff line number Diff line change
@@ -829,12 +829,7 @@ impl<'tcx> DeadVisitor<'tcx> {
}
};

self.tcx.emit_spanned_lint(
lint,
first_hir_id,
MultiSpan::from_spans(spans),
diag,
);
self.tcx.emit_spanned_lint(lint, first_hir_id, MultiSpan::from_spans(spans), diag);
}

fn warn_dead_code_grouped_by_lint_level(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one can be named warn_multiple.

@@ -915,11 +910,7 @@ fn check_mod_deathness(tcx: TyCtxt<'_>, module: LocalDefId) {
let hir = tcx.hir().local_def_id_to_hir_id(def_id);
let level = tcx.lint_level_at_node(lint::builtin::DEAD_CODE, hir).0;

dead_items.push(DeadVariant {
def_id,
name,
level,
})
dead_items.push(DeadVariant { def_id, name, level })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DeadVariant needs to be renamed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what the right name would be for this. I renamed it to DeadItem.

}
}
visitor.warn_dead_code_grouped_by_lint_level(
@@ -982,7 +973,12 @@ fn check_mod_deathness(tcx: TyCtxt<'_>, module: LocalDefId) {
}
})
.collect();
visitor.warn_dead_code_grouped_by_lint_level(def_id, "read", dead_fields, is_positional)
visitor.warn_dead_code_grouped_by_lint_level(
def_id,
"read",
dead_fields,
is_positional,
)
}

visitor.warn_dead_code_grouped_by_lint_level(