diff --git a/src/librustc/hir/def.rs b/src/librustc/hir/def.rs index 87af450451e..0719eb701a9 100644 --- a/src/librustc/hir/def.rs +++ b/src/librustc/hir/def.rs @@ -142,7 +142,6 @@ pub enum Res { Upvar(Id, // `HirId` of closed over local usize, // index in the `freevars` list of the closure ast::NodeId), // expr node that creates the closure - Label(ast::NodeId), // Macro namespace NonMacroAttr(NonMacroAttrKind), // e.g., `#[inline]` or `#[rustfmt::skip]` @@ -349,7 +348,6 @@ pub fn opt_def_id(&self) -> Option { Res::Local(..) | Res::Upvar(..) | - Res::Label(..) | Res::PrimTy(..) | Res::SelfTy(..) | Res::SelfCtor(..) | @@ -377,7 +375,6 @@ pub fn descr(&self) -> &'static str { Res::PrimTy(..) => "builtin type", Res::Local(..) => "local variable", Res::Upvar(..) => "closure capture", - Res::Label(..) => "label", Res::SelfTy(..) => "self type", Res::ToolMod => "tool module", Res::NonMacroAttr(attr_kind) => attr_kind.descr(), @@ -405,7 +402,6 @@ pub fn map_id(self, mut map: impl FnMut(Id) -> R) -> Res { index, closure ), - Res::Label(id) => Res::Label(id), Res::SelfTy(a, b) => Res::SelfTy(a, b), Res::ToolMod => Res::ToolMod, Res::NonMacroAttr(attr_kind) => Res::NonMacroAttr(attr_kind), diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 9ae9995be43..fc3987a4b19 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -151,6 +151,9 @@ fn resolve_hir_path( /// Obtain per-namespace resolutions for `use` statement with the given `NoedId`. fn get_import_res(&mut self, id: NodeId) -> PerNS>>; + /// Obtain resolution for a label with the given `NodeId`. + fn get_label_res(&mut self, id: NodeId) -> Option; + /// We must keep the set of definitions up to date as we add nodes that weren't in the AST. /// This should only return `None` during testing. fn definitions(&mut self) -> &mut Definitions; @@ -1246,7 +1249,7 @@ fn lower_label(&mut self, label: Option