Add a test for #2021
This commit is contained in:
parent
ba8233d361
commit
881c5b5a6d
@ -425,3 +425,12 @@ fn issue_2099() {
|
||||
|
||||
match x {}
|
||||
}
|
||||
|
||||
// #2021
|
||||
impl<'tcx> Const<'tcx> {
|
||||
pub fn from_constval<'a>() -> Const<'tcx> {
|
||||
let val = match *cv {
|
||||
ConstVal::Variant(_) | ConstVal::Aggregate(..) | ConstVal::Unevaluated(..) => bug!("MIR must not use `{:?}` (aggregates are expanded to MIR rvalues)", cv),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -463,3 +463,15 @@ fn issue_2099() {
|
||||
|
||||
match x {}
|
||||
}
|
||||
|
||||
// #2021
|
||||
impl<'tcx> Const<'tcx> {
|
||||
pub fn from_constval<'a>() -> Const<'tcx> {
|
||||
let val = match *cv {
|
||||
ConstVal::Variant(_) | ConstVal::Aggregate(..) | ConstVal::Unevaluated(..) => bug!(
|
||||
"MIR must not use `{:?}` (aggregates are expanded to MIR rvalues)",
|
||||
cv
|
||||
),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user