@@ -6,7 +6,6 @@ use either::Right;
6
6
use rustc_const_eval:: const_eval:: CheckAlignment ;
7
7
use rustc_const_eval:: InterpErrorExt ;
8
8
use rustc_data_structures:: fx:: FxHashSet ;
9
- use rustc_errors:: { DiagnosticMessage , IntoDiagnostic } ;
10
9
use rustc_hir:: def:: DefKind ;
11
10
use rustc_index:: bit_set:: BitSet ;
12
11
use rustc_index:: { IndexSlice , IndexVec } ;
@@ -17,7 +16,6 @@ use rustc_middle::mir::*;
17
16
use rustc_middle:: ty:: layout:: { LayoutError , LayoutOf , LayoutOfHelpers , TyAndLayout } ;
18
17
use rustc_middle:: ty:: InternalSubsts ;
19
18
use rustc_middle:: ty:: { self , ConstKind , Instance , ParamEnv , Ty , TyCtxt , TypeVisitableExt } ;
20
- use rustc_span:: sym:: DiagnosticMessage ;
21
19
use rustc_span:: { def_id:: DefId , Span , DUMMY_SP } ;
22
20
use rustc_target:: abi:: { self , Align , HasDataLayout , Size , TargetDataLayout } ;
23
21
use rustc_target:: spec:: abi:: Abi as CallAbi ;
@@ -388,17 +386,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
388
386
op
389
387
}
390
388
Err ( e) => {
391
- let msg = ty:: tls:: with ( move |tcx| {
392
- let handler = & tcx. sess . parse_sess . span_diagnostic ;
393
- let err = InterpErrorExt ( e. into_kind ( ) ) ;
394
- let builder = err. into_diagnostic ( handler) ;
395
- builder. cancel ( ) ;
396
- "Should be diagnostic message"
397
- } ) ;
398
- trace ! (
399
- "get_const failed: {:?}" ,
400
- todo!( "find a way to convert diagnostic builder to string" )
401
- ) ;
389
+ trace ! ( "get_const failed: {}" , InterpErrorExt ( e. into_kind( ) ) . to_string( ) ) ;
402
390
return None ;
403
391
}
404
392
} ;
0 commit comments