@@ -51,6 +51,7 @@ use rustc_data_structures::tagged_ptr::TaggedRef;
51
51
use rustc_errors:: { DiagArgFromDisplay , DiagCtxtHandle } ;
52
52
use rustc_hir:: def:: { DefKind , LifetimeRes , Namespace , PartialRes , PerNS , Res } ;
53
53
use rustc_hir:: def_id:: { CRATE_DEF_ID , LOCAL_CRATE , LocalDefId } ;
54
+ use rustc_hir:: definitions:: { DefPathData , DisambiguatorState } ;
54
55
use rustc_hir:: lints:: DelayedLint ;
55
56
use rustc_hir:: {
56
57
self as hir, AngleBrackets , ConstArg , GenericArg , HirId , ItemLocalMap , LangItem ,
@@ -92,6 +93,7 @@ rustc_fluent_macro::fluent_messages! { "../messages.ftl" }
92
93
struct LoweringContext < ' a , ' hir > {
93
94
tcx : TyCtxt < ' hir > ,
94
95
resolver : & ' a mut ResolverAstLowering ,
96
+ disambiguator : DisambiguatorState ,
95
97
96
98
/// Used to allocate HIR nodes.
97
99
arena : & ' hir hir:: Arena < ' hir > ,
@@ -154,6 +156,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
154
156
// Pseudo-globals.
155
157
tcx,
156
158
resolver,
159
+ disambiguator : DisambiguatorState :: new ( ) ,
157
160
arena : tcx. hir_arena ,
158
161
159
162
// HirId handling.
@@ -520,6 +523,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
520
523
node_id : ast:: NodeId ,
521
524
name : Option < Symbol > ,
522
525
def_kind : DefKind ,
526
+ def_path_data : DefPathData ,
523
527
span : Span ,
524
528
) -> LocalDefId {
525
529
let parent = self . current_hir_id_owner . def_id ;
@@ -535,7 +539,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
535
539
let def_id = self
536
540
. tcx
537
541
. 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 )
539
543
. def_id ( ) ;
540
544
541
545
debug ! ( "create_def: def_id_to_node_id[{:?}] <-> {:?}" , def_id, node_id) ;
@@ -820,6 +824,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
820
824
param,
821
825
Some ( kw:: UnderscoreLifetime ) ,
822
826
DefKind :: LifetimeParam ,
827
+ DefPathData :: DesugaredAnonymousLifetime ,
823
828
ident. span ,
824
829
) ;
825
830
debug ! ( ?_def_id) ;
@@ -2154,7 +2159,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
2154
2159
// We're lowering a const argument that was originally thought to be a type argument,
2155
2160
// so the def collector didn't create the def ahead of time. That's why we have to do
2156
2161
// it here.
2157
- let def_id = self . create_def ( node_id, None , DefKind :: AnonConst , span) ;
2162
+ let def_id = self . create_def (
2163
+ node_id,
2164
+ None ,
2165
+ DefKind :: AnonConst ,
2166
+ DefPathData :: LateAnonConst ,
2167
+ span,
2168
+ ) ;
2158
2169
let hir_id = self . lower_node_id ( node_id) ;
2159
2170
2160
2171
let path_expr = Expr {
0 commit comments