1 error[E0658]: `transmute` is not allowed in constant functions
2 --> $DIR/feature-gate-const_fn_transmute.rs:8:43
4 LL | const fn transmute_fn() -> u32 { unsafe { mem::transmute(Foo(3)) } }
5 | ^^^^^^^^^^^^^^^^^^^^^^
7 = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
8 = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
9 = note: `transmute` is only allowed in constants and statics for now
11 error[E0658]: `transmute` is not allowed in constant functions
12 --> $DIR/feature-gate-const_fn_transmute.rs:11:53
14 LL | const fn transmute_fn_intrinsic() -> u32 { unsafe { std::intrinsics::transmute(Foo(3)) } }
15 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
18 = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
19 = note: `transmute` is only allowed in constants and statics for now
21 error[E0658]: `transmute` is not allowed in constant functions
22 --> $DIR/feature-gate-const_fn_transmute.rs:14:58
24 LL | const fn transmute_fn_core_intrinsic() -> u32 { unsafe { core::intrinsics::transmute(Foo(3)) } }
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27 = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
28 = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
29 = note: `transmute` is only allowed in constants and statics for now
31 error[E0658]: `transmute` is not allowed in constant functions
32 --> $DIR/feature-gate-const_fn_transmute.rs:17:48
34 LL | const unsafe fn unsafe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
35 | ^^^^^^^^^^^^^^^^^^^^^^
37 = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
38 = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
39 = note: `transmute` is only allowed in constants and statics for now
41 error[E0658]: `transmute` is not allowed in constant functions
42 --> $DIR/feature-gate-const_fn_transmute.rs:20:58
44 LL | const unsafe fn unsafe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
45 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47 = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
48 = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
49 = note: `transmute` is only allowed in constants and statics for now
51 error[E0658]: `transmute` is not allowed in constant functions
52 --> $DIR/feature-gate-const_fn_transmute.rs:23:63
54 LL | const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
57 = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
58 = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
59 = note: `transmute` is only allowed in constants and statics for now
61 error[E0658]: `transmute` is not allowed in constant functions
62 --> $DIR/feature-gate-const_fn_transmute.rs:26:39
64 LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
65 | ^^^^^^^^^^^^^^^^^^^^^^
67 = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
68 = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
69 = note: `transmute` is only allowed in constants and statics for now
71 error[E0658]: `transmute` is not allowed in constant functions
72 --> $DIR/feature-gate-const_fn_transmute.rs:30:49
74 LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
75 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
81 error[E0658]: `transmute` is not allowed in constant functions
82 --> $DIR/feature-gate-const_fn_transmute.rs:34:54
84 LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
85 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87 = note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
88 = help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
89 = note: `transmute` is only allowed in constants and statics for now
91 error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
92 --> $DIR/feature-gate-const_fn_transmute.rs:26:39
94 LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
95 | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
97 = note: consult the function's documentation for information on how to avoid undefined behavior
99 error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
100 --> $DIR/feature-gate-const_fn_transmute.rs:30:49
102 LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
105 = note: consult the function's documentation for information on how to avoid undefined behavior
107 error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
108 --> $DIR/feature-gate-const_fn_transmute.rs:34:54
110 LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
113 = note: consult the function's documentation for information on how to avoid undefined behavior
115 error: aborting due to 12 previous errors
117 Some errors have detailed explanations: E0133, E0658.
118 For more information about an error, try `rustc --explain E0133`.