@@ -58,6 +58,14 @@ LL | const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrins
5858 = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
5959 = note: `transmute` is only allowed in constants and statics for now
6060
61+ error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
62+ --> $DIR/feature-gate-const_fn_transmute.rs:29:39
63+ |
64+ LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
65+ | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
66+ |
67+ = note: consult the function's documentation for information on how to avoid undefined behavior
68+
6169error[E0658]: `transmute` is not allowed in constant functions
6270 --> $DIR/feature-gate-const_fn_transmute.rs:29:39
6371 |
@@ -68,49 +76,41 @@ LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
6876 = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
6977 = note: `transmute` is only allowed in constants and statics for now
7078
71- error[E0658 ]: `transmute` is not allowed in constant functions
79+ error[E0133 ]: call to unsafe function is unsafe and requires unsafe function or block
7280 --> $DIR/feature-gate-const_fn_transmute.rs:33:49
7381 |
7482LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
75- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
7684 |
77- = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
78- = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
79- = note: `transmute` is only allowed in constants and statics for now
85+ = note: consult the function's documentation for information on how to avoid undefined behavior
8086
8187error[E0658]: `transmute` is not allowed in constant functions
82- --> $DIR/feature-gate-const_fn_transmute.rs:37:54
88+ --> $DIR/feature-gate-const_fn_transmute.rs:33:49
8389 |
84- LL | const fn safe_transmute_fn_core_intrinsic () -> u32 { core ::intrinsics::transmute(Foo(3)) }
85- | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90+ LL | const fn safe_transmute_fn_intrinsic () -> u32 { std ::intrinsics::transmute(Foo(3)) }
91+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8692 |
8793 = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
8894 = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
8995 = note: `transmute` is only allowed in constants and statics for now
9096
9197error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
92- --> $DIR/feature-gate-const_fn_transmute.rs:29:39
93- |
94- LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
95- | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
96- |
97- = note: consult the function's documentation for information on how to avoid undefined behavior
98-
99- error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
100- --> $DIR/feature-gate-const_fn_transmute.rs:33:49
98+ --> $DIR/feature-gate-const_fn_transmute.rs:37:54
10199 |
102- LL | const fn safe_transmute_fn_intrinsic () -> u32 { std ::intrinsics::transmute(Foo(3)) }
103- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
100+ LL | const fn safe_transmute_fn_core_intrinsic () -> u32 { core ::intrinsics::transmute(Foo(3)) }
101+ | ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
104102 |
105103 = note: consult the function's documentation for information on how to avoid undefined behavior
106104
107- error[E0133 ]: call to unsafe function is unsafe and requires unsafe function or block
105+ error[E0658 ]: `transmute` is not allowed in constant functions
108106 --> $DIR/feature-gate-const_fn_transmute.rs:37:54
109107 |
110108LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
111- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
109+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112110 |
113- = note: consult the function's documentation for information on how to avoid undefined behavior
111+ = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
112+ = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
113+ = note: `transmute` is only allowed in constants and statics for now
114114
115115error: aborting due to 12 previous errors
116116
0 commit comments