@@ -51,6 +51,7 @@ use rustc_data_structures::tagged_ptr::TaggedRef;
5151use rustc_errors:: { DiagArgFromDisplay , DiagCtxtHandle } ;
5252use rustc_hir:: def:: { DefKind , LifetimeRes , Namespace , PartialRes , PerNS , Res } ;
5353use rustc_hir:: def_id:: { CRATE_DEF_ID , LOCAL_CRATE , LocalDefId } ;
54+ use rustc_hir:: definitions:: { DefPathData , DisambiguatorState } ;
5455use rustc_hir:: lints:: DelayedLint ;
5556use rustc_hir:: {
5657 self as hir, AngleBrackets , ConstArg , GenericArg , HirId , ItemLocalMap , LifetimeSource ,
@@ -93,6 +94,7 @@ rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
9394struct LoweringContext < ' a , ' hir > {
9495 tcx : TyCtxt < ' hir > ,
9596 resolver : & ' a mut ResolverAstLowering ,
97+ disambiguator : DisambiguatorState ,
9698
9799 /// Used to allocate HIR nodes.
98100 arena : & ' hir hir:: Arena < ' hir > ,
@@ -155,6 +157,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
155157 // Pseudo-globals.
156158 tcx,
157159 resolver,
160+ disambiguator : DisambiguatorState :: new ( ) ,
158161 arena : tcx. hir_arena ,
159162
160163 // HirId handling.
@@ -545,6 +548,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
545548 node_id : ast:: NodeId ,
546549 name : Option < Symbol > ,
547550 def_kind : DefKind ,
551+ def_path_data : DefPathData ,
548552 span : Span ,
549553 ) -> LocalDefId {
550554 let parent = self . current_hir_id_owner . def_id ;
@@ -560,7 +564,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
560564 let def_id = self
561565 . tcx
562566 . at ( span)
563- . create_def ( parent, name, def_kind, None , & mut self . resolver . disambiguator )
567+ . create_def ( parent, name, def_kind, Some ( def_path_data ) , & mut self . disambiguator )
564568 . def_id ( ) ;
565569
566570 debug ! ( "create_def: def_id_to_node_id[{:?}] <-> {:?}" , def_id, node_id) ;
@@ -845,6 +849,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
845849 param,
846850 Some ( kw:: UnderscoreLifetime ) ,
847851 DefKind :: LifetimeParam ,
852+ DefPathData :: DesugaredAnonymousLifetime ,
848853 ident. span ,
849854 ) ;
850855 debug ! ( ?_def_id) ;
@@ -2279,7 +2284,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
22792284 // We're lowering a const argument that was originally thought to be a type argument,
22802285 // so the def collector didn't create the def ahead of time. That's why we have to do
22812286 // it here.
2282- let def_id = self . create_def ( node_id, None , DefKind :: AnonConst , span) ;
2287+ let def_id = self . create_def (
2288+ node_id,
2289+ None ,
2290+ DefKind :: AnonConst ,
2291+ DefPathData :: LateAnonConst ,
2292+ span,
2293+ ) ;
22832294 let hir_id = self . lower_node_id ( node_id) ;
22842295
22852296 let path_expr = Expr {
0 commit comments