@@ -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 , LangItem ,
@@ -92,6 +93,7 @@ rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
9293struct LoweringContext < ' a , ' hir > {
9394 tcx : TyCtxt < ' hir > ,
9495 resolver : & ' a mut ResolverAstLowering ,
96+ disambiguator : DisambiguatorState ,
9597
9698 /// Used to allocate HIR nodes.
9799 arena : & ' hir hir:: Arena < ' hir > ,
@@ -154,6 +156,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
154156 // Pseudo-globals.
155157 tcx,
156158 resolver,
159+ disambiguator : DisambiguatorState :: new ( ) ,
157160 arena : tcx. hir_arena ,
158161
159162 // HirId handling.
@@ -520,6 +523,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
520523 node_id : ast:: NodeId ,
521524 name : Option < Symbol > ,
522525 def_kind : DefKind ,
526+ def_path_data : DefPathData ,
523527 span : Span ,
524528 ) -> LocalDefId {
525529 let parent = self . current_hir_id_owner . def_id ;
@@ -535,7 +539,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
535539 let def_id = self
536540 . tcx
537541 . at ( span)
538- . create_def ( parent, name, def_kind, None , & mut self . resolver . disambiguator )
542+ . create_def ( parent, name, def_kind, Some ( def_path_data ) , & mut self . disambiguator )
539543 . def_id ( ) ;
540544
541545 debug ! ( "create_def: def_id_to_node_id[{:?}] <-> {:?}" , def_id, node_id) ;
@@ -820,6 +824,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
820824 param,
821825 Some ( kw:: UnderscoreLifetime ) ,
822826 DefKind :: LifetimeParam ,
827+ DefPathData :: DesugaredAnonymousLifetime ,
823828 ident. span ,
824829 ) ;
825830 debug ! ( ?_def_id) ;
@@ -2155,7 +2160,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
21552160 // We're lowering a const argument that was originally thought to be a type argument,
21562161 // so the def collector didn't create the def ahead of time. That's why we have to do
21572162 // it here.
2158- let def_id = self . create_def ( node_id, None , DefKind :: AnonConst , span) ;
2163+ let def_id = self . create_def (
2164+ node_id,
2165+ None ,
2166+ DefKind :: AnonConst ,
2167+ DefPathData :: LateAnonConst ,
2168+ span,
2169+ ) ;
21592170 let hir_id = self . lower_node_id ( node_id) ;
21602171
21612172 let path_expr = Expr {
0 commit comments