Add a test for #2021
This commit is contained in:
parent
ba8233d361
commit
881c5b5a6d
2 changed files with 21 additions and 0 deletions
|
@ -425,3 +425,12 @@ fn issue_2099() {
|
||||||
|
|
||||||
match x {}
|
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 {}
|
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…
Reference in a new issue