Skip to content

Commit

Permalink
Use correct feature gate for unsizing casts
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed Sep 22, 2020
1 parent 6044836 commit 186d148
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions compiler/rustc_mir/src/transform/check_consts/ops.rs
Expand Up @@ -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) {
Expand Down

0 comments on commit 186d148

Please sign in to comment.