@@ -17,7 +17,9 @@ use rustc_hir::{BindingMode, ByRef, LetStmt, LocalSource, Node};
17
17
use rustc_middle:: middle:: region;
18
18
use rustc_middle:: mir:: { self , * } ;
19
19
use rustc_middle:: thir:: { self , * } ;
20
- use rustc_middle:: ty:: { self , CanonicalUserTypeAnnotation , Ty , TypeVisitableExt , ValTreeKind } ;
20
+ use rustc_middle:: ty:: {
21
+ self , CanonicalUserTypeAnnotation , Ty , TypeVisitableExt , ValTree , ValTreeKind ,
22
+ } ;
21
23
use rustc_middle:: { bug, span_bug} ;
22
24
use rustc_pattern_analysis:: rustc:: { DeconstructedPat , RustcPatCtxt } ;
23
25
use rustc_span:: { BytePos , Pos , Span , Symbol , sym} ;
@@ -2919,6 +2921,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
2919
2921
ty:: ConstKind :: Value ( cv) => break ' a ( cv. valtree , cv. ty ) ,
2920
2922
other => span_bug ! ( constant. span, "{other:#?}" ) ,
2921
2923
} ,
2924
+ mir:: Const :: Val ( mir:: ConstValue :: Scalar ( mir:: interpret:: Scalar :: Int ( val) ) , ty) => {
2925
+ break ' a ( ValTree :: from_scalar_int ( self . tcx , val) , ty) ;
2926
+ }
2922
2927
// We should never encounter `Const::Val` unless MIR opts (like const prop) evaluate
2923
2928
// a constant and write that value back into `Operand`s. This could happen, but is
2924
2929
// unlikely. Also: all users of `simd_shuffle` are on unstable and already need to take
0 commit comments