Skip to content

Commit

Permalink
delete useless pub detect during check unused
Browse files Browse the repository at this point in the history
  • Loading branch information
bvanjoi committed Oct 12, 2023
1 parent 10570e9 commit 541e2f9
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions compiler/rustc_resolve/src/check_unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ struct UnusedImportCheckVisitor<'a, 'b, 'tcx> {
base_use_tree: Option<&'a ast::UseTree>,
base_id: ast::NodeId,
item_span: Span,
base_use_is_pub: bool,
}

struct ExternCrateToLint {
Expand Down Expand Up @@ -146,7 +145,6 @@ impl<'a, 'b, 'tcx> Visitor<'a> for UnusedImportCheckVisitor<'a, 'b, 'tcx> {
// because this means that they were generated in some fashion by the
// compiler and we don't need to consider them.
ast::ItemKind::Use(..) if item.span.is_dummy() => return,
ast::ItemKind::Use(..) => self.base_use_is_pub = item.vis.kind.is_pub(),
ast::ItemKind::ExternCrate(orig_name) => {
self.extern_crate_items.push(ExternCrateToLint {
id: item.id,
Expand Down Expand Up @@ -332,7 +330,6 @@ impl Resolver<'_, '_> {
base_use_tree: None,
base_id: ast::DUMMY_NODE_ID,
item_span: DUMMY_SP,
base_use_is_pub: false,
};
visit::walk_crate(&mut visitor, krate);

Expand Down

0 comments on commit 541e2f9

Please sign in to comment.