@@ -30,7 +30,7 @@ use syntax::ast::Mutability;
30
30
use super :: {
31
31
Pointer , AllocId , Allocation , ConstValue , GlobalId ,
32
32
EvalResult , Scalar , EvalErrorKind , AllocType , PointerArithmetic ,
33
- Machine , MemoryAccess , AllocMap , MayLeak , ScalarMaybeUndef ,
33
+ Machine , MemoryAccess , AllocMap , MayLeak , ScalarMaybeUndef , ErrorHandled ,
34
34
} ;
35
35
36
36
#[ derive( Debug , PartialEq , Eq , Copy , Clone , Hash ) ]
@@ -370,10 +370,13 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
370
370
} ;
371
371
// use the raw query here to break validation cycles. Later uses of the static will call the
372
372
// full query anyway
373
- tcx. const_eval_raw ( ty:: ParamEnv :: reveal_all ( ) . and ( gid) ) . map_err ( |_ | {
373
+ tcx. const_eval_raw ( ty:: ParamEnv :: reveal_all ( ) . and ( gid) ) . map_err ( |err | {
374
374
// no need to report anything, the const_eval call takes care of that for statics
375
375
assert ! ( tcx. is_static( def_id) . is_some( ) ) ;
376
- EvalErrorKind :: ReferencedConstant . into ( )
376
+ match err {
377
+ ErrorHandled :: Reported => EvalErrorKind :: ReferencedConstant . into ( ) ,
378
+ ErrorHandled :: TooGeneric => EvalErrorKind :: TooGeneric . into ( ) ,
379
+ }
377
380
} ) . map ( |const_val| {
378
381
if let ConstValue :: ByRef ( _, allocation, _) = const_val. val {
379
382
// We got tcx memory. Let the machine figure out whether and how to
0 commit comments