@@ -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.
@@ -525,6 +528,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
525528 node_id : ast:: NodeId ,
526529 name : Option < Symbol > ,
527530 def_kind : DefKind ,
531+ def_path_data : DefPathData ,
528532 span : Span ,
529533 ) -> LocalDefId {
530534 let parent = self . current_hir_id_owner . def_id ;
@@ -540,7 +544,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
540544 let def_id = self
541545 . tcx
542546 . at ( span)
543- . create_def ( parent, name, def_kind, None , & mut self . resolver . disambiguator )
547+ . create_def ( parent, name, def_kind, Some ( def_path_data ) , & mut self . disambiguator )
544548 . def_id ( ) ;
545549
546550 debug ! ( "create_def: def_id_to_node_id[{:?}] <-> {:?}" , def_id, node_id) ;
@@ -825,6 +829,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
825829 param,
826830 Some ( kw:: UnderscoreLifetime ) ,
827831 DefKind :: LifetimeParam ,
832+ DefPathData :: DesugaredAnonymousLifetime ,
828833 ident. span ,
829834 ) ;
830835 debug ! ( ?_def_id) ;
@@ -2160,7 +2165,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
21602165 // We're lowering a const argument that was originally thought to be a type argument,
21612166 // so the def collector didn't create the def ahead of time. That's why we have to do
21622167 // it here.
2163- let def_id = self . create_def ( node_id, None , DefKind :: AnonConst , span) ;
2168+ let def_id = self . create_def (
2169+ node_id,
2170+ None ,
2171+ DefKind :: AnonConst ,
2172+ DefPathData :: LateAnonConst ,
2173+ span,
2174+ ) ;
21642175 let hir_id = self . lower_node_id ( node_id) ;
21652176
21662177 let path_expr = Expr {
0 commit comments