File tree 1 file changed +8
-3
lines changed
compiler/rustc_save_analysis/src
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -780,13 +780,18 @@ impl<'tcx> DumpVisitor<'tcx> {
780
780
variant : & ' tcx ty:: VariantDef ,
781
781
rest : Option < & ' tcx hir:: Expr < ' tcx > > ,
782
782
) {
783
- if let Some ( struct_lit_data ) = self . save_ctxt . get_expr_data ( ex) {
783
+ if let Some ( _ex_res_data ) = self . save_ctxt . get_expr_data ( ex) {
784
784
if let hir:: QPath :: Resolved ( _, path) = path {
785
785
self . write_sub_paths_truncated ( path) ;
786
786
}
787
- down_cast_data ! ( struct_lit_data, RefData , ex. span) ;
787
+ // For MyEnum::MyVariant, get_expr_data gives us MyEnum, not MyVariant.
788
+ // For recording the span's ref id, we want MyVariant.
788
789
if !generated_code ( ex. span ) {
789
- self . dumper . dump_ref ( struct_lit_data) ;
790
+ let sub_span = path. last_segment_span ( ) ;
791
+ let span = self . save_ctxt . span_from_span ( sub_span) ;
792
+ let reff =
793
+ Ref { kind : RefKind :: Type , span, ref_id : id_from_def_id ( variant. def_id ) } ;
794
+ self . dumper . dump_ref ( reff) ;
790
795
}
791
796
792
797
for field in fields {
You can’t perform that action at this time.
0 commit comments