about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-07-28 00:53:17 +0000
committerbors <bors@rust-lang.org>2021-07-28 00:53:17 +0000
commit8b50cc9a2c408caef30a1cf950c948509b2f648e (patch)
tree44d9a23d35a8ffcd724fd58ece2027d67cb6b270 /src/test
parent2faabf579323f5252329264cc53ba9ff803429a3 (diff)
parent37af39957399db5a40923827fa54b3814d5e495d (diff)
downloadrust-8b50cc9a2c408caef30a1cf950c948509b2f648e.tar.gz
rust-8b50cc9a2c408caef30a1cf950c948509b2f648e.zip
Auto merge of #85769 - jhpratt:stabilize-const-transmute-union, r=RalfJung
Stabilize `const_fn_transmute`, `const_fn_union`

This PR stabilizes the `const_fn_transmute` and `const_fn_union` features. It _does not_ stabilize any methods (obviously aside from `transmute`) that are blocked on only these features.

Closes #53605. Closes #51909.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/mir-opt/issues/issue-75439.rs4
-rw-r--r--src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff78
-rw-r--r--src/test/ui/consts/const-eval/const_transmute.rs1
-rw-r--r--src/test/ui/consts/const-eval/feature-gate-const_fn_union.rs11
-rw-r--r--src/test/ui/consts/const-eval/feature-gate-const_fn_union.stderr12
-rw-r--r--src/test/ui/consts/const-eval/issue-49296.rs1
-rw-r--r--src/test/ui/consts/const-eval/issue-49296.stderr2
-rw-r--r--src/test/ui/consts/const-eval/promoted_const_fn_fail.rs2
-rw-r--r--src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr2
-rw-r--r--src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs2
-rw-r--r--src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr2
-rw-r--r--src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr6
-rw-r--r--src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr6
-rw-r--r--src/test/ui/consts/const-eval/ref_to_int_match.rs1
-rw-r--r--src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr12
-rw-r--r--src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr12
-rw-r--r--src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs1
-rw-r--r--src/test/ui/consts/const-fn-not-safe-for-const.rs10
-rw-r--r--src/test/ui/consts/issue-69532.rs1
-rw-r--r--src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs6
-rw-r--r--src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr11
-rw-r--r--src/test/ui/consts/promote-not.rs1
-rw-r--r--src/test/ui/consts/promote-not.stderr26
-rw-r--r--src/test/ui/feature-gates/feature-gate-const_fn_transmute.mir.stderr118
-rw-r--r--src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs41
-rw-r--r--src/test/ui/feature-gates/feature-gate-const_fn_transmute.thir.stderr118
-rw-r--r--src/test/ui/internal/internal-unstable-const.rs7
-rw-r--r--src/test/ui/internal/internal-unstable-const.stderr20
-rw-r--r--src/test/ui/union/union-const-eval.rs4
29 files changed, 96 insertions, 422 deletions
diff --git a/src/test/mir-opt/issues/issue-75439.rs b/src/test/mir-opt/issues/issue-75439.rs
index b914055813f..ae2e036312e 100644
--- a/src/test/mir-opt/issues/issue-75439.rs
+++ b/src/test/mir-opt/issues/issue-75439.rs
@@ -1,7 +1,5 @@
 // EMIT_MIR issue_75439.foo.MatchBranchSimplification.diff
 
-#![feature(const_fn_transmute)]
-
 use std::mem::transmute;
 
 pub fn foo(bytes: [u8; 16]) -> Option<[u8; 4]> {
@@ -16,5 +14,5 @@ pub fn foo(bytes: [u8; 16]) -> Option<[u8; 4]> {
 }
 
 fn main() {
-  let _ = foo([0; 16]);
+    let _ = foo([0; 16]);
 }
diff --git a/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff b/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
index d5edf165252..4d1b6bedd5f 100644
--- a/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
+++ b/src/test/mir-opt/issues/issue_75439.foo.MatchBranchSimplification.diff
@@ -2,17 +2,17 @@
 + // MIR for `foo` after MatchBranchSimplification
   
   fn foo(_1: [u8; 16]) -> Option<[u8; 4]> {
-      debug bytes => _1;                   // in scope 0 at $DIR/issue-75439.rs:7:12: 7:17
-      let mut _0: std::option::Option<[u8; 4]>; // return place in scope 0 at $DIR/issue-75439.rs:7:32: 7:47
-      let _2: [u32; 4];                    // in scope 0 at $DIR/issue-75439.rs:9:9: 9:15
-      let mut _3: [u8; 16];                // in scope 0 at $DIR/issue-75439.rs:9:47: 9:52
-      let mut _5: [u8; 4];                 // in scope 0 at $DIR/issue-75439.rs:12:14: 12:38
-      let mut _6: u32;                     // in scope 0 at $DIR/issue-75439.rs:12:33: 12:35
+      debug bytes => _1;                   // in scope 0 at $DIR/issue-75439.rs:5:12: 5:17
+      let mut _0: std::option::Option<[u8; 4]>; // return place in scope 0 at $DIR/issue-75439.rs:5:32: 5:47
+      let _2: [u32; 4];                    // in scope 0 at $DIR/issue-75439.rs:7:9: 7:15
+      let mut _3: [u8; 16];                // in scope 0 at $DIR/issue-75439.rs:7:47: 7:52
+      let mut _5: [u8; 4];                 // in scope 0 at $DIR/issue-75439.rs:10:14: 10:38
+      let mut _6: u32;                     // in scope 0 at $DIR/issue-75439.rs:10:33: 10:35
       scope 1 {
-          debug dwords => _2;              // in scope 1 at $DIR/issue-75439.rs:9:9: 9:15
-          let _4: u32;                     // in scope 1 at $DIR/issue-75439.rs:11:27: 11:29
+          debug dwords => _2;              // in scope 1 at $DIR/issue-75439.rs:7:9: 7:15
+          let _4: u32;                     // in scope 1 at $DIR/issue-75439.rs:9:27: 9:29
           scope 3 {
-              debug ip => _4;              // in scope 3 at $DIR/issue-75439.rs:11:27: 11:29
+              debug ip => _4;              // in scope 3 at $DIR/issue-75439.rs:9:27: 9:29
               scope 4 {
               }
           }
@@ -21,67 +21,67 @@
       }
   
       bb0: {
-          StorageLive(_2);                 // scope 0 at $DIR/issue-75439.rs:9:9: 9:15
-          StorageLive(_3);                 // scope 2 at $DIR/issue-75439.rs:9:47: 9:52
-          _3 = _1;                         // scope 2 at $DIR/issue-75439.rs:9:47: 9:52
-          _2 = transmute::<[u8; 16], [u32; 4]>(move _3) -> bb1; // scope 2 at $DIR/issue-75439.rs:9:37: 9:53
+          StorageLive(_2);                 // scope 0 at $DIR/issue-75439.rs:7:9: 7:15
+          StorageLive(_3);                 // scope 2 at $DIR/issue-75439.rs:7:47: 7:52
+          _3 = _1;                         // scope 2 at $DIR/issue-75439.rs:7:47: 7:52
+          _2 = transmute::<[u8; 16], [u32; 4]>(move _3) -> bb1; // scope 2 at $DIR/issue-75439.rs:7:37: 7:53
                                            // mir::Constant
-                                           // + span: $DIR/issue-75439.rs:9:37: 9:46
+                                           // + span: $DIR/issue-75439.rs:7:37: 7:46
                                            // + literal: Const { ty: unsafe extern "rust-intrinsic" fn([u8; 16]) -> [u32; 4] {std::intrinsics::transmute::<[u8; 16], [u32; 4]>}, val: Value(Scalar(<ZST>)) }
       }
   
       bb1: {
-          StorageDead(_3);                 // scope 2 at $DIR/issue-75439.rs:9:52: 9:53
-          switchInt(_2[0 of 4]) -> [0_u32: bb2, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:11:13: 11:14
+          StorageDead(_3);                 // scope 2 at $DIR/issue-75439.rs:7:52: 7:53
+          switchInt(_2[0 of 4]) -> [0_u32: bb2, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:9:13: 9:14
       }
   
       bb2: {
-          switchInt(_2[1 of 4]) -> [0_u32: bb3, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:11:16: 11:17
+          switchInt(_2[1 of 4]) -> [0_u32: bb3, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:9:16: 9:17
       }
   
       bb3: {
-          switchInt(_2[2 of 4]) -> [0_u32: bb6, 4294901760_u32: bb7, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:11:19: 11:20
+          switchInt(_2[2 of 4]) -> [0_u32: bb6, 4294901760_u32: bb7, otherwise: bb4]; // scope 1 at $DIR/issue-75439.rs:9:19: 9:20
       }
   
       bb4: {
-          discriminant(_0) = 0;            // scope 1 at $DIR/issue-75439.rs:14:9: 14:13
-          goto -> bb9;                     // scope 1 at $DIR/issue-75439.rs:11:5: 15:6
+          discriminant(_0) = 0;            // scope 1 at $DIR/issue-75439.rs:12:9: 12:13
+          goto -> bb9;                     // scope 1 at $DIR/issue-75439.rs:9:5: 13:6
       }
   
       bb5: {
-          StorageLive(_5);                 // scope 3 at $DIR/issue-75439.rs:12:14: 12:38
-          StorageLive(_6);                 // scope 4 at $DIR/issue-75439.rs:12:33: 12:35
-          _6 = _4;                         // scope 4 at $DIR/issue-75439.rs:12:33: 12:35
-          _5 = transmute::<u32, [u8; 4]>(move _6) -> bb8; // scope 4 at $DIR/issue-75439.rs:12:23: 12:36
+          StorageLive(_5);                 // scope 3 at $DIR/issue-75439.rs:10:14: 10:38
+          StorageLive(_6);                 // scope 4 at $DIR/issue-75439.rs:10:33: 10:35
+          _6 = _4;                         // scope 4 at $DIR/issue-75439.rs:10:33: 10:35
+          _5 = transmute::<u32, [u8; 4]>(move _6) -> bb8; // scope 4 at $DIR/issue-75439.rs:10:23: 10:36
                                            // mir::Constant
-                                           // + span: $DIR/issue-75439.rs:12:23: 12:32
+                                           // + span: $DIR/issue-75439.rs:10:23: 10:32
                                            // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u32) -> [u8; 4] {std::intrinsics::transmute::<u32, [u8; 4]>}, val: Value(Scalar(<ZST>)) }
       }
   
       bb6: {
-          StorageLive(_4);                 // scope 1 at $DIR/issue-75439.rs:11:27: 11:29
-          _4 = _2[3 of 4];                 // scope 1 at $DIR/issue-75439.rs:11:27: 11:29
-          goto -> bb5;                     // scope 1 at $DIR/issue-75439.rs:11:5: 15:6
+          StorageLive(_4);                 // scope 1 at $DIR/issue-75439.rs:9:27: 9:29
+          _4 = _2[3 of 4];                 // scope 1 at $DIR/issue-75439.rs:9:27: 9:29
+          goto -> bb5;                     // scope 1 at $DIR/issue-75439.rs:9:5: 13:6
       }
   
       bb7: {
-          StorageLive(_4);                 // scope 1 at $DIR/issue-75439.rs:11:27: 11:29
-          _4 = _2[3 of 4];                 // scope 1 at $DIR/issue-75439.rs:11:27: 11:29
-          goto -> bb5;                     // scope 1 at $DIR/issue-75439.rs:11:5: 15:6
+          StorageLive(_4);                 // scope 1 at $DIR/issue-75439.rs:9:27: 9:29
+          _4 = _2[3 of 4];                 // scope 1 at $DIR/issue-75439.rs:9:27: 9:29
+          goto -> bb5;                     // scope 1 at $DIR/issue-75439.rs:9:5: 13:6
       }
   
       bb8: {
-          StorageDead(_6);                 // scope 4 at $DIR/issue-75439.rs:12:35: 12:36
-          ((_0 as Some).0: [u8; 4]) = move _5; // scope 3 at $DIR/issue-75439.rs:12:9: 12:39
-          discriminant(_0) = 1;            // scope 3 at $DIR/issue-75439.rs:12:9: 12:39
-          StorageDead(_5);                 // scope 3 at $DIR/issue-75439.rs:12:38: 12:39
-          StorageDead(_4);                 // scope 1 at $DIR/issue-75439.rs:13:5: 13:6
-          goto -> bb9;                     // scope 1 at $DIR/issue-75439.rs:11:5: 15:6
+          StorageDead(_6);                 // scope 4 at $DIR/issue-75439.rs:10:35: 10:36
+          ((_0 as Some).0: [u8; 4]) = move _5; // scope 3 at $DIR/issue-75439.rs:10:9: 10:39
+          discriminant(_0) = 1;            // scope 3 at $DIR/issue-75439.rs:10:9: 10:39
+          StorageDead(_5);                 // scope 3 at $DIR/issue-75439.rs:10:38: 10:39
+          StorageDead(_4);                 // scope 1 at $DIR/issue-75439.rs:11:5: 11:6
+          goto -> bb9;                     // scope 1 at $DIR/issue-75439.rs:9:5: 13:6
       }
   
       bb9: {
-          StorageDead(_2);                 // scope 0 at $DIR/issue-75439.rs:16:1: 16:2
-          return;                          // scope 0 at $DIR/issue-75439.rs:16:2: 16:2
+          StorageDead(_2);                 // scope 0 at $DIR/issue-75439.rs:14:1: 14:2
+          return;                          // scope 0 at $DIR/issue-75439.rs:14:2: 14:2
       }
   }
   
diff --git a/src/test/ui/consts/const-eval/const_transmute.rs b/src/test/ui/consts/const-eval/const_transmute.rs
index f0e1d826302..90a454c75a1 100644
--- a/src/test/ui/consts/const-eval/const_transmute.rs
+++ b/src/test/ui/consts/const-eval/const_transmute.rs
@@ -1,6 +1,5 @@
 // run-pass
 
-#![feature(const_fn_union)]
 #![allow(dead_code)]
 
 #[repr(C)]
diff --git a/src/test/ui/consts/const-eval/feature-gate-const_fn_union.rs b/src/test/ui/consts/const-eval/feature-gate-const_fn_union.rs
deleted file mode 100644
index 26162aa6228..00000000000
--- a/src/test/ui/consts/const-eval/feature-gate-const_fn_union.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-fn main() {}
-
-#[repr(C)]
-union Foo {
-    u: u32,
-    i: i32,
-}
-
-const unsafe fn foo(u: u32) -> i32 {
-    Foo { u }.i //~ ERROR unions in const fn are unstable
-}
diff --git a/src/test/ui/consts/const-eval/feature-gate-const_fn_union.stderr b/src/test/ui/consts/const-eval/feature-gate-const_fn_union.stderr
deleted file mode 100644
index bc3b6aa6653..00000000000
--- a/src/test/ui/consts/const-eval/feature-gate-const_fn_union.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: unions in const fn are unstable
-  --> $DIR/feature-gate-const_fn_union.rs:10:5
-   |
-LL |     Foo { u }.i
-   |     ^^^^^^^^^^^
-   |
-   = note: see issue #51909 <https://github.com/rust-lang/rust/issues/51909> for more information
-   = help: add `#![feature(const_fn_union)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/consts/const-eval/issue-49296.rs b/src/test/ui/consts/const-eval/issue-49296.rs
index baa1848e9c3..ba0885532f1 100644
--- a/src/test/ui/consts/const-eval/issue-49296.rs
+++ b/src/test/ui/consts/const-eval/issue-49296.rs
@@ -1,6 +1,5 @@
 // issue-49296: Unsafe shenigans in constants can result in missing errors
 
-#![feature(const_fn_union)]
 #![feature(const_fn_trait_bound)]
 
 const unsafe fn transmute<T: Copy, U: Copy>(t: T) -> U {
diff --git a/src/test/ui/consts/const-eval/issue-49296.stderr b/src/test/ui/consts/const-eval/issue-49296.stderr
index 4fd8e189096..e87ef160b82 100644
--- a/src/test/ui/consts/const-eval/issue-49296.stderr
+++ b/src/test/ui/consts/const-eval/issue-49296.stderr
@@ -1,5 +1,5 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/issue-49296.rs:19:16
+  --> $DIR/issue-49296.rs:18:16
    |
 LL | const X: u64 = *wat(42);
    |                ^^^^^^^^ pointer to alloc2 was dereferenced after this allocation got freed
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs b/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs
index 1a99c77c6dd..1fc7af63765 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs
@@ -1,5 +1,3 @@
-#![feature(const_fn_union)]
-
 #![allow(const_err)]
 
 #[repr(C)]
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr b/src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr
index 6618f1cd1c0..c6ca30e09bd 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr
@@ -1,5 +1,5 @@
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promoted_const_fn_fail.rs:21:27
+  --> $DIR/promoted_const_fn_fail.rs:19:27
    |
 LL |     let x: &'static u8 = &(bar() + 1);
    |            -----------    ^^^^^^^^^^^ creates a temporary which is freed while still in use
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs
index c9e4871bb7c..c53424664f2 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs
@@ -1,5 +1,3 @@
-#![feature(const_fn_union)]
-
 #![deny(const_err)]
 
 #[repr(C)]
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr
index 5f9f3bda87b..c6275a835e5 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr
@@ -1,5 +1,5 @@
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promoted_const_fn_fail_deny_const_err.rs:22:27
+  --> $DIR/promoted_const_fn_fail_deny_const_err.rs:20:27
    |
 LL |     let x: &'static u8 = &(bar() + 1);
    |            -----------    ^^^^^^^^^^^ creates a temporary which is freed while still in use
diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr
index ff90bb5fdd2..aa5ba53fb1b 100644
--- a/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ref_to_int_match.rs:26:1
+  --> $DIR/ref_to_int_match.rs:25:1
    |
 LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc3, but expected initialized plain (non-pointer) bytes
@@ -10,13 +10,13 @@ LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
            }
 
 error: could not evaluate constant pattern
-  --> $DIR/ref_to_int_match.rs:8:14
+  --> $DIR/ref_to_int_match.rs:7:14
    |
 LL |         10..=BAR => {},
    |              ^^^
 
 error: could not evaluate constant pattern
-  --> $DIR/ref_to_int_match.rs:8:14
+  --> $DIR/ref_to_int_match.rs:7:14
    |
 LL |         10..=BAR => {},
    |              ^^^
diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr
index 499c4536c4b..525a6217506 100644
--- a/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ref_to_int_match.rs:26:1
+  --> $DIR/ref_to_int_match.rs:25:1
    |
 LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc3, but expected initialized plain (non-pointer) bytes
@@ -10,13 +10,13 @@ LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
            }
 
 error: could not evaluate constant pattern
-  --> $DIR/ref_to_int_match.rs:8:14
+  --> $DIR/ref_to_int_match.rs:7:14
    |
 LL |         10..=BAR => {},
    |              ^^^
 
 error: could not evaluate constant pattern
-  --> $DIR/ref_to_int_match.rs:8:14
+  --> $DIR/ref_to_int_match.rs:7:14
    |
 LL |         10..=BAR => {},
    |              ^^^
diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.rs b/src/test/ui/consts/const-eval/ref_to_int_match.rs
index 0741e425d9b..b098adf8389 100644
--- a/src/test/ui/consts/const-eval/ref_to_int_match.rs
+++ b/src/test/ui/consts/const-eval/ref_to_int_match.rs
@@ -1,5 +1,4 @@
 // stderr-per-bitwidth
-#![feature(const_fn_union)]
 
 fn main() {
     let n: Int = 40;
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
index 0022d19e953..7dc1ec865af 100644
--- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
+++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/validate_uninhabited_zsts.rs:5:14
+  --> $DIR/validate_uninhabited_zsts.rs:4:14
    |
 LL |     unsafe { std::mem::transmute(()) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^
    |              |
    |              transmuting to uninhabited type
-   |              inside `foo` at $DIR/validate_uninhabited_zsts.rs:5:14
+   |              inside `foo` at $DIR/validate_uninhabited_zsts.rs:4:14
 ...
 LL | const FOO: [Empty; 3] = [foo(); 3];
-   |                          ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:14:26
+   |                          ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:13:26
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/validate_uninhabited_zsts.rs:17:1
+  --> $DIR/validate_uninhabited_zsts.rs:16:1
    |
 LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at [0]: encountered a value of uninhabited type Empty
@@ -20,7 +20,7 @@ LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    = note: the raw bytes of the constant (size: 0, align: 1) {}
 
 warning: the type `!` does not permit zero-initialization
-  --> $DIR/validate_uninhabited_zsts.rs:5:14
+  --> $DIR/validate_uninhabited_zsts.rs:4:14
    |
 LL |     unsafe { std::mem::transmute(()) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^
@@ -32,7 +32,7 @@ LL |     unsafe { std::mem::transmute(()) }
    = note: the `!` type has no valid value
 
 warning: the type `Empty` does not permit zero-initialization
-  --> $DIR/validate_uninhabited_zsts.rs:17:35
+  --> $DIR/validate_uninhabited_zsts.rs:16:35
    |
 LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
index 0022d19e953..7dc1ec865af 100644
--- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
+++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/validate_uninhabited_zsts.rs:5:14
+  --> $DIR/validate_uninhabited_zsts.rs:4:14
    |
 LL |     unsafe { std::mem::transmute(()) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^
    |              |
    |              transmuting to uninhabited type
-   |              inside `foo` at $DIR/validate_uninhabited_zsts.rs:5:14
+   |              inside `foo` at $DIR/validate_uninhabited_zsts.rs:4:14
 ...
 LL | const FOO: [Empty; 3] = [foo(); 3];
-   |                          ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:14:26
+   |                          ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:13:26
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/validate_uninhabited_zsts.rs:17:1
+  --> $DIR/validate_uninhabited_zsts.rs:16:1
    |
 LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at [0]: encountered a value of uninhabited type Empty
@@ -20,7 +20,7 @@ LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    = note: the raw bytes of the constant (size: 0, align: 1) {}
 
 warning: the type `!` does not permit zero-initialization
-  --> $DIR/validate_uninhabited_zsts.rs:5:14
+  --> $DIR/validate_uninhabited_zsts.rs:4:14
    |
 LL |     unsafe { std::mem::transmute(()) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^
@@ -32,7 +32,7 @@ LL |     unsafe { std::mem::transmute(()) }
    = note: the `!` type has no valid value
 
 warning: the type `Empty` does not permit zero-initialization
-  --> $DIR/validate_uninhabited_zsts.rs:17:35
+  --> $DIR/validate_uninhabited_zsts.rs:16:35
    |
 LL | const BAR: [Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
index f6b6a1f53eb..34650484556 100644
--- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
+++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
@@ -1,5 +1,4 @@
 // stderr-per-bitwidth
-#![feature(const_fn_transmute)]
 
 const fn foo() -> ! {
     unsafe { std::mem::transmute(()) }
diff --git a/src/test/ui/consts/const-fn-not-safe-for-const.rs b/src/test/ui/consts/const-fn-not-safe-for-const.rs
index 726d6e9f74b..b2fe73ae930 100644
--- a/src/test/ui/consts/const-fn-not-safe-for-const.rs
+++ b/src/test/ui/consts/const-fn-not-safe-for-const.rs
@@ -1,10 +1,10 @@
 // Test that we can't call random fns in a const fn or do other bad things.
 
-#![feature(const_fn_transmute)]
-
 use std::mem::transmute;
 
-fn random() -> u32 { 0 }
+fn random() -> u32 {
+    0
+}
 
 const fn sub(x: &u32) -> usize {
     unsafe { transmute(x) }
@@ -18,12 +18,12 @@ static Y: u32 = 0;
 
 const fn get_Y() -> u32 {
     Y
-        //~^ ERROR E0013
+    //~^ ERROR E0013
 }
 
 const fn get_Y_addr() -> &'static u32 {
     &Y
-        //~^ ERROR E0013
+    //~^ ERROR E0013
 }
 
 const fn get() -> u32 {
diff --git a/src/test/ui/consts/issue-69532.rs b/src/test/ui/consts/issue-69532.rs
index 81007b15074..0a891781299 100644
--- a/src/test/ui/consts/issue-69532.rs
+++ b/src/test/ui/consts/issue-69532.rs
@@ -1,5 +1,4 @@
 // run-pass
-#![feature(const_fn_transmute)]
 
 const fn make_nans() -> (f64, f64, f32, f32) {
     let nan1: f64 = unsafe { std::mem::transmute(0x7FF0_0001_0000_0001u64) };
diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs
index 0c8af5a199a..719a7a9172a 100644
--- a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs
+++ b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.rs
@@ -8,9 +8,3 @@ const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static usize
 //~^ dereferencing raw pointers in constant functions
 
 fn main() {}
-
-const unsafe fn no_union() {
-    union Foo { x: (), y: () }
-    Foo { x: () }.y
-    //~^ unions in const fn
-}
diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
index 322052c28fa..86ff4721c21 100644
--- a/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
+++ b/src/test/ui/consts/min_const_fn/min_const_fn_unsafe_bad.stderr
@@ -25,15 +25,6 @@ LL | const unsafe fn bad_const_unsafe_deref_raw_ref(x: *mut usize) -> &'static u
    = note: see issue #51911 <https://github.com/rust-lang/rust/issues/51911> for more information
    = help: add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable
 
-error[E0658]: unions in const fn are unstable
-  --> $DIR/min_const_fn_unsafe_bad.rs:14:5
-   |
-LL |     Foo { x: () }.y
-   |     ^^^^^^^^^^^^^^^
-   |
-   = note: see issue #51909 <https://github.com/rust-lang/rust/issues/51909> for more information
-   = help: add `#![feature(const_fn_union)]` to the crate attributes to enable
-
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/consts/promote-not.rs b/src/test/ui/consts/promote-not.rs
index 20c1169c26e..99926532247 100644
--- a/src/test/ui/consts/promote-not.rs
+++ b/src/test/ui/consts/promote-not.rs
@@ -1,7 +1,6 @@
 // ignore-tidy-linelength
 // Test various things that we do not want to promote.
 #![allow(unconditional_panic, const_err)]
-#![feature(const_fn_union)]
 
 use std::cell::Cell;
 
diff --git a/src/test/ui/consts/promote-not.stderr b/src/test/ui/consts/promote-not.stderr
index 108d0da7a67..932109bd86d 100644
--- a/src/test/ui/consts/promote-not.stderr
+++ b/src/test/ui/consts/promote-not.stderr
@@ -1,5 +1,5 @@
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:9:50
+  --> $DIR/promote-not.rs:8:50
    |
 LL | static mut TEST1: Option<&mut [i32]> = Some(&mut [1, 2, 3]);
    |                                        ----------^^^^^^^^^-
@@ -9,7 +9,7 @@ LL | static mut TEST1: Option<&mut [i32]> = Some(&mut [1, 2, 3]);
    |                                        using this value as a static requires that borrow lasts for `'static`
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:12:18
+  --> $DIR/promote-not.rs:11:18
    |
 LL |     let x = &mut [1,2,3];
    |                  ^^^^^^^ creates a temporary which is freed while still in use
@@ -19,7 +19,7 @@ LL | };
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:21:32
+  --> $DIR/promote-not.rs:20:32
    |
 LL |         let _x: &'static () = &foo();
    |                 -----------    ^^^^^ creates a temporary which is freed while still in use
@@ -29,7 +29,7 @@ LL |     }
    |     - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:29:29
+  --> $DIR/promote-not.rs:28:29
    |
 LL |     let _x: &'static i32 = &unsafe { U { x: 0 }.x };
    |             ------------    ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -39,7 +39,7 @@ LL | }
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:34:29
+  --> $DIR/promote-not.rs:33:29
    |
 LL |     let _x: &'static i32 = &unsafe { U { x: 0 }.x };
    |             ------------    ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -49,7 +49,7 @@ LL | };
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:40:29
+  --> $DIR/promote-not.rs:39:29
    |
 LL |     let _val: &'static _ = &(Cell::new(1), 2).1;
    |               ----------    ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -59,7 +59,7 @@ LL | };
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:45:29
+  --> $DIR/promote-not.rs:44:29
    |
 LL |     let _val: &'static _ = &(Cell::new(1), 2).0;
    |               ----------    ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -70,7 +70,7 @@ LL | }
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:46:29
+  --> $DIR/promote-not.rs:45:29
    |
 LL |     let _val: &'static _ = &(Cell::new(1), 2).1;
    |               ----------    ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -81,7 +81,7 @@ LL | }
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:49:29
+  --> $DIR/promote-not.rs:48:29
    |
 LL |     let _val: &'static _ = &(1/0);
    |               ----------    ^^^^^ creates a temporary which is freed while still in use
@@ -92,7 +92,7 @@ LL | }
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:50:29
+  --> $DIR/promote-not.rs:49:29
    |
 LL |     let _val: &'static _ = &(1/(1-1));
    |               ----------    ^^^^^^^^^ creates a temporary which is freed while still in use
@@ -103,7 +103,7 @@ LL | }
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:51:29
+  --> $DIR/promote-not.rs:50:29
    |
 LL |     let _val: &'static _ = &(1%0);
    |               ----------    ^^^^^ creates a temporary which is freed while still in use
@@ -114,7 +114,7 @@ LL | }
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:52:29
+  --> $DIR/promote-not.rs:51:29
    |
 LL |     let _val: &'static _ = &(1%(1-1));
    |               ----------    ^^^^^^^^^ creates a temporary which is freed while still in use
@@ -125,7 +125,7 @@ LL | }
    | - temporary value is freed at the end of this statement
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/promote-not.rs:53:29
+  --> $DIR/promote-not.rs:52:29
    |
 LL |     let _val: &'static _ = &([1,2,3][4]+1);
    |               ----------    ^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
diff --git a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.mir.stderr b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.mir.stderr
deleted file mode 100644
index 04efea0b230..00000000000
--- a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.mir.stderr
+++ /dev/null
@@ -1,118 +0,0 @@
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:11:43
-   |
-LL | const fn transmute_fn() -> u32 { unsafe { mem::transmute(Foo(3)) } }
-   |                                           ^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:14:53
-   |
-LL | const fn transmute_fn_intrinsic() -> u32 { unsafe { std::intrinsics::transmute(Foo(3)) } }
-   |                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:17:58
-   |
-LL | const fn transmute_fn_core_intrinsic() -> u32 { unsafe { core::intrinsics::transmute(Foo(3)) } }
-   |                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:20:48
-   |
-LL | const unsafe fn unsafe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
-   |                                                ^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:23:58
-   |
-LL | const unsafe fn unsafe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
-   |                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:26:63
-   |
-LL | const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
-   |                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:29:39
-   |
-LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
-   |                                       ^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:33:49
-   |
-LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
-   |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:37:54
-   |
-LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
-   |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
-  --> $DIR/feature-gate-const_fn_transmute.rs:29:39
-   |
-LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
-   |                                       ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
-   |
-   = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
-  --> $DIR/feature-gate-const_fn_transmute.rs:33:49
-   |
-LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
-   |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
-   |
-   = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
-  --> $DIR/feature-gate-const_fn_transmute.rs:37:54
-   |
-LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
-   |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
-   |
-   = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error: aborting due to 12 previous errors
-
-Some errors have detailed explanations: E0133, E0658.
-For more information about an error, try `rustc --explain E0133`.
diff --git a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs
deleted file mode 100644
index 9a45dbc51d4..00000000000
--- a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.rs
+++ /dev/null
@@ -1,41 +0,0 @@
-// revisions: mir thir
-// [thir]compile-flags: -Z thir-unsafeck
-
-use std::mem;
-
-#[repr(transparent)]
-struct Foo(u32);
-
-const TRANSMUTED_U32: u32 = unsafe { mem::transmute(Foo(3)) };
-
-const fn transmute_fn() -> u32 { unsafe { mem::transmute(Foo(3)) } }
-//~^ ERROR `transmute`
-
-const fn transmute_fn_intrinsic() -> u32 { unsafe { std::intrinsics::transmute(Foo(3)) } }
-//~^ ERROR `transmute`
-
-const fn transmute_fn_core_intrinsic() -> u32 { unsafe { core::intrinsics::transmute(Foo(3)) } }
-//~^ ERROR `transmute`
-
-const unsafe fn unsafe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
-//~^ ERROR `transmute`
-
-const unsafe fn unsafe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
-//~^ ERROR `transmute`
-
-const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
-//~^ ERROR `transmute`
-
-const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
-//~^ ERROR `transmute`
-//~| ERROR call to unsafe function is unsafe and requires unsafe function or block
-
-const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
-//~^ ERROR `transmute`
-//~| ERROR call to unsafe function is unsafe and requires unsafe function or block
-
-const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
-//~^ ERROR `transmute`
-//~| ERROR call to unsafe function is unsafe and requires unsafe function or block
-
-fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.thir.stderr b/src/test/ui/feature-gates/feature-gate-const_fn_transmute.thir.stderr
deleted file mode 100644
index df0de7a9590..00000000000
--- a/src/test/ui/feature-gates/feature-gate-const_fn_transmute.thir.stderr
+++ /dev/null
@@ -1,118 +0,0 @@
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:11:43
-   |
-LL | const fn transmute_fn() -> u32 { unsafe { mem::transmute(Foo(3)) } }
-   |                                           ^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:14:53
-   |
-LL | const fn transmute_fn_intrinsic() -> u32 { unsafe { std::intrinsics::transmute(Foo(3)) } }
-   |                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:17:58
-   |
-LL | const fn transmute_fn_core_intrinsic() -> u32 { unsafe { core::intrinsics::transmute(Foo(3)) } }
-   |                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:20:48
-   |
-LL | const unsafe fn unsafe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
-   |                                                ^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:23:58
-   |
-LL | const unsafe fn unsafe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
-   |                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:26:63
-   |
-LL | const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
-   |                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
-  --> $DIR/feature-gate-const_fn_transmute.rs:29:39
-   |
-LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
-   |                                       ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
-   |
-   = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:29:39
-   |
-LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
-   |                                       ^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
-  --> $DIR/feature-gate-const_fn_transmute.rs:33:49
-   |
-LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
-   |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
-   |
-   = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:33:49
-   |
-LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
-   |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
-  --> $DIR/feature-gate-const_fn_transmute.rs:37:54
-   |
-LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
-   |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
-   |
-   = note: consult the function's documentation for information on how to avoid undefined behavior
-
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/feature-gate-const_fn_transmute.rs:37:54
-   |
-LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
-   |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
-
-error: aborting due to 12 previous errors
-
-Some errors have detailed explanations: E0133, E0658.
-For more information about an error, try `rustc --explain E0133`.
diff --git a/src/test/ui/internal/internal-unstable-const.rs b/src/test/ui/internal/internal-unstable-const.rs
index 470262a15ba..4ec2426dfee 100644
--- a/src/test/ui/internal/internal-unstable-const.rs
+++ b/src/test/ui/internal/internal-unstable-const.rs
@@ -1,14 +1,13 @@
 // Don't allow unstable features in stable functions without `allow_internal_unstable`.
 
 #![stable(feature = "rust1", since = "1.0.0")]
-
 #![feature(staged_api)]
-#![feature(const_transmute)]
+#![feature(const_fn_floating_point_arithmetic)]
 
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
-pub const fn foo() -> i32 {
-    unsafe { std::mem::transmute(4u32) } //~ ERROR `transmute`
+pub const fn foo() -> f32 {
+    1.0 + 1.0 //~ ERROR const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
 }
 
 fn main() {}
diff --git a/src/test/ui/internal/internal-unstable-const.stderr b/src/test/ui/internal/internal-unstable-const.stderr
index adfb8dc3691..37d2ea6d2dc 100644
--- a/src/test/ui/internal/internal-unstable-const.stderr
+++ b/src/test/ui/internal/internal-unstable-const.stderr
@@ -1,13 +1,17 @@
-error[E0658]: `transmute` is not allowed in constant functions
-  --> $DIR/internal-unstable-const.rs:11:14
+error: const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
+  --> $DIR/internal-unstable-const.rs:10:5
    |
-LL |     unsafe { std::mem::transmute(4u32) }
-   |              ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |     1.0 + 1.0
+   |     ^^^^^^^^^
+   |
+help: if it is not part of the public API, make this function unstably const
+   |
+LL | #[rustc_const_unstable(feature = "...", issue = "...")]
+   |
+help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
+   |
+LL | #[rustc_allow_const_fn_unstable(const_fn_floating_point_arithmetic)]
    |
-   = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
-   = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
-   = note: `transmute` is only allowed in constants and statics for now
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/union/union-const-eval.rs b/src/test/ui/union/union-const-eval.rs
index 0b6788b4226..32ee4a739ea 100644
--- a/src/test/ui/union/union-const-eval.rs
+++ b/src/test/ui/union/union-const-eval.rs
@@ -1,9 +1,7 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // revisions: mirunsafeck thirunsafeck
 // [thirunsafeck]compile-flags: -Z thir-unsafeck
 
-#![feature(const_fn_union)]
-
 union U {
     a: usize,
     b: usize,