File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
compiler/rustc_save_analysis/src Expand file tree Collapse file tree 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> {
780780 variant : & ' tcx ty:: VariantDef ,
781781 rest : Option < & ' tcx hir:: Expr < ' tcx > > ,
782782 ) {
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) {
784784 if let hir:: QPath :: Resolved ( _, path) = path {
785785 self . write_sub_paths_truncated ( path) ;
786786 }
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.
788789 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) ;
790795 }
791796
792797 for field in fields {
You can’t perform that action at this time.
0 commit comments