@@ -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. 
98100arena :  & ' 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. 
@@ -546,6 +549,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
546549 node_id :  ast:: NodeId , 
547550 name :  Option < Symbol > , 
548551 def_kind :  DefKind , 
552+  def_path_data :  DefPathData , 
549553 span :  Span , 
550554 )  -> LocalDefId  { 
551555 let  parent = self . current_hir_id_owner . def_id ; 
@@ -561,7 +565,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
561565 let  def_id = self 
562566 . tcx 
563567 . at ( span) 
564-  . create_def ( parent,  name,  def_kind,  None ,  & mut  self . resolver . disambiguator ) 
568+  . create_def ( parent,  name,  def_kind,  Some ( def_path_data ) ,  & mut  self . disambiguator ) 
565569 . def_id ( ) ; 
566570
567571 debug ! ( "create_def: def_id_to_node_id[{:?}] <-> {:?}" ,  def_id,  node_id) ; 
@@ -846,6 +850,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
846850 param, 
847851 Some ( kw:: UnderscoreLifetime ) , 
848852 DefKind :: LifetimeParam , 
853+  DefPathData :: DesugaredAnonymousLifetime , 
849854 ident. span , 
850855 ) ; 
851856 debug ! ( ?_def_id) ; 
@@ -2290,7 +2295,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
22902295 // We're lowering a const argument that was originally thought to be a type argument, 
22912296 // so the def collector didn't create the def ahead of time. That's why we have to do 
22922297 // it here. 
2293-  let  def_id = self . create_def ( node_id,  None ,  DefKind :: AnonConst ,  span) ; 
2298+  let  def_id = self . create_def ( 
2299+  node_id, 
2300+  None , 
2301+  DefKind :: AnonConst , 
2302+  DefPathData :: LateAnonConst , 
2303+  span, 
2304+  ) ; 
22942305 let  hir_id = self . lower_node_id ( node_id) ; 
22952306
22962307 let  path_expr = Expr  { 
0 commit comments