@@ -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.
@@ -525,6 +528,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
525
528
node_id : ast:: NodeId ,
526
529
name : Option < Symbol > ,
527
530
def_kind : DefKind ,
531
+ def_path_data : DefPathData ,
528
532
span : Span ,
529
533
) -> LocalDefId {
530
534
let parent = self . current_hir_id_owner . def_id ;
@@ -540,7 +544,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
540
544
let def_id = self
541
545
. tcx
542
546
. 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 )
544
548
. def_id ( ) ;
545
549
546
550
debug ! ( "create_def: def_id_to_node_id[{:?}] <-> {:?}" , def_id, node_id) ;
@@ -825,6 +829,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
825
829
param,
826
830
Some ( kw:: UnderscoreLifetime ) ,
827
831
DefKind :: LifetimeParam ,
832
+ DefPathData :: DesugaredAnonymousLifetime ,
828
833
ident. span ,
829
834
) ;
830
835
debug ! ( ?_def_id) ;
@@ -2160,7 +2165,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
2160
2165
// We're lowering a const argument that was originally thought to be a type argument,
2161
2166
// so the def collector didn't create the def ahead of time. That's why we have to do
2162
2167
// 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
+ ) ;
2164
2175
let hir_id = self . lower_node_id ( node_id) ;
2165
2176
2166
2177
let path_expr = Expr {
0 commit comments