@@ -209,6 +209,9 @@ pub struct PerOwnerResolverData {
209209 pub node_id_to_def_id : NodeMap < LocalDefId > = Default :: default ( ) ,
210210 /// Whether lifetime elision was successful.
211211 pub lifetime_elision_allowed : bool = false,
212+ /// Resolutions for labels.
213+ /// Maps from NodeId of the break/continue expression to the NodeId of their corresponding blocks or loops.
214+ pub label_res_map : NodeMap < ast:: NodeId > = Default :: default ( ) ,
212215
213216 /// The id of the owner
214217 pub id : ast:: NodeId ,
@@ -220,6 +223,11 @@ impl PerOwnerResolverData {
220223 pub fn new ( id : ast:: NodeId , def_id : LocalDefId ) -> PerOwnerResolverData {
221224 PerOwnerResolverData { id, def_id, .. }
222225 }
226+
227+ /// Obtains resolution for a label with the given `NodeId`.
228+ pub fn get_label_res ( & self , id : ast:: NodeId ) -> Option < ast:: NodeId > {
229+ self . label_res_map . get ( & id) . copied ( )
230+ }
223231}
224232
225233/// Resolutions that should only be used for lowering.
@@ -230,8 +238,6 @@ pub struct ResolverAstLowering<'tcx> {
230238 pub partial_res_map : NodeMap < hir:: def:: PartialRes > ,
231239 /// Resolutions for import nodes, which have multiple resolutions in different namespaces.
232240 pub import_res_map : NodeMap < hir:: def:: PerNS < Option < Res < ast:: NodeId > > > > ,
233- /// Resolutions for labels (node IDs of their corresponding blocks or loops).
234- pub label_res_map : NodeMap < ast:: NodeId > ,
235241 /// Resolutions for lifetimes.
236242 pub lifetimes_res_map : NodeMap < LifetimeRes > ,
237243 /// Lifetime parameters that lowering will have to introduce.
0 commit comments