Skip to content

Commit 9450f82

Browse files
committed
Unused tuple fields in rustc_resolve.
1 parent ec83476 commit 9450f82

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

compiler/rustc_resolve/src/build_reduced_graph.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
524524
let crate_root = self.r.resolve_crate_root(source.ident);
525525
let crate_name = match crate_root.kind {
526526
ModuleKind::Def(.., name) => name,
527-
ModuleKind::Block(..) => unreachable!(),
527+
ModuleKind::Block => unreachable!(),
528528
};
529529
// HACK(eddyb) unclear how good this is, but keeping `$crate`
530530
// in `source` breaks `src/test/ui/imports/import-crate-var.rs`,
@@ -936,7 +936,7 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
936936
if self.block_needs_anonymous_module(block) {
937937
let module = self.r.new_module(
938938
Some(parent),
939-
ModuleKind::Block(block.id),
939+
ModuleKind::Block,
940940
expansion.to_expn_id(),
941941
block.span,
942942
parent.no_implicit_prelude,

compiler/rustc_resolve/src/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl<'a> Resolver<'a> {
163163

164164
let container = match parent.kind {
165165
ModuleKind::Def(kind, _, _) => kind.descr(parent.def_id()),
166-
ModuleKind::Block(..) => "block",
166+
ModuleKind::Block => "block",
167167
};
168168

169169
let old_noun = match old_binding.is_import() {

compiler/rustc_resolve/src/ident.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ impl<'a> Resolver<'a> {
218218
return Some((self.expn_def_scope(ctxt.remove_mark()), None));
219219
}
220220

221-
if let ModuleKind::Block(..) = module.kind {
221+
if let ModuleKind::Block = module.kind {
222222
return Some((module.parent.unwrap().nearest_item_scope(), None));
223223
}
224224

@@ -333,7 +333,7 @@ impl<'a> Resolver<'a> {
333333
};
334334

335335
match module.kind {
336-
ModuleKind::Block(..) => {} // We can see through blocks
336+
ModuleKind::Block => {} // We can see through blocks
337337
_ => break,
338338
}
339339

compiler/rustc_resolve/src/late/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
14341434
// Items from this module
14351435
self.r.add_module_candidates(module, &mut names, &filter_fn);
14361436

1437-
if let ModuleKind::Block(..) = module.kind {
1437+
if let ModuleKind::Block = module.kind {
14381438
// We can see through blocks
14391439
} else {
14401440
// Items from the prelude

compiler/rustc_resolve/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ enum ModuleKind {
436436
/// f(); // Resolves to (1)
437437
/// }
438438
/// ```
439-
Block(NodeId),
439+
Block,
440440
/// Any module with a name.
441441
///
442442
/// This could be:
@@ -453,7 +453,7 @@ impl ModuleKind {
453453
/// Get name of the module.
454454
pub fn name(&self) -> Option<Symbol> {
455455
match self {
456-
ModuleKind::Block(..) => None,
456+
ModuleKind::Block => None,
457457
ModuleKind::Def(.., name) => Some(*name),
458458
}
459459
}
@@ -529,7 +529,7 @@ impl<'a> ModuleData<'a> {
529529
) -> Self {
530530
let is_foreign = match kind {
531531
ModuleKind::Def(_, def_id, _) => !def_id.is_local(),
532-
ModuleKind::Block(_) => false,
532+
ModuleKind::Block => false,
533533
};
534534
ModuleData {
535535
parent,

0 commit comments

Comments
 (0)