Skip to content

Commit 186d148

Browse files
Use correct feature gate for unsizing casts
1 parent 6044836 commit 186d148

File tree

1 file changed

+1
-5
lines changed
  • compiler/rustc_mir/src/transform/check_consts

1 file changed

+1
-5
lines changed

compiler/rustc_mir/src/transform/check_consts/ops.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -523,11 +523,7 @@ impl NonConstOp for UnionAccess {
523523
pub struct UnsizingCast;
524524
impl NonConstOp for UnsizingCast {
525525
fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status {
526-
if ccx.const_kind() != hir::ConstContext::ConstFn {
527-
Status::Allowed
528-
} else {
529-
Status::Unstable(sym::const_fn_transmute)
530-
}
526+
mcf_status_in_item(ccx)
531527
}
532528

533529
fn emit_error(&self, ccx: &ConstCx<'_, '_>, span: Span) {

0 commit comments

Comments
 (0)