Add a test for #2021

This commit is contained in:
Seiichi Uchida 2017-11-11 23:14:01 +09:00
parent ba8233d361
commit 881c5b5a6d
2 changed files with 21 additions and 0 deletions

View file

@ -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),
};
}
}

View file

@ -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
),
};
}
}