Use correct feature gate for unsizing casts

This commit is contained in:
Dylan MacKenzie 2020-09-22 10:21:58 -07:00
parent 6044836284
commit 186d148b4c

View File

@ -523,11 +523,7 @@ impl NonConstOp for UnionAccess {
pub struct UnsizingCast;
impl NonConstOp for UnsizingCast {
fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status {
if ccx.const_kind() != hir::ConstContext::ConstFn {
Status::Allowed
} else {
Status::Unstable(sym::const_fn_transmute)
}
mcf_status_in_item(ccx)
}
fn emit_error(&self, ccx: &ConstCx<'_, '_>, span: Span) {