File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1975,8 +1975,12 @@ impl<'tcx> Const<'tcx> {
1975
1975
ty : ParamEnvAnd < ' tcx , Ty < ' tcx > > ,
1976
1976
) -> & ' tcx Self {
1977
1977
let ty = tcx. lift_to_global ( & ty) . unwrap ( ) ;
1978
- let layout = tcx. layout_of ( ty) . unwrap_or_else ( |e| {
1979
- panic ! ( "could not compute layout for {:?}: {:?}" , ty, e)
1978
+ let layout = tcx. layout_of ( ty) . unwrap_or_else ( |_| {
1979
+ // FIXME: add delay_span_bug call, we can only get here if there are errors
1980
+ // we produce a weird dummy layout with somewhat sane values
1981
+ let mut layout = tcx. layout_of ( ParamEnv :: reveal_all ( ) . and ( tcx. types . u128 ) ) . unwrap ( ) ;
1982
+ layout. ty = ty. value ;
1983
+ layout
1980
1984
} ) ;
1981
1985
let mut bytes = [ 0_u8 ; 16 ] ;
1982
1986
let endian = tcx. data_layout . endian ;
You can’t perform that action at this time.
0 commit comments