@@ -58,6 +58,14 @@ LL | const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrins
58
58
= help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
59
59
= note: `transmute` is only allowed in constants and statics for now
60
60
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
+
61
69
error[E0658]: `transmute` is not allowed in constant functions
62
70
--> $DIR/feature-gate-const_fn_transmute.rs:29:39
63
71
|
@@ -68,49 +76,41 @@ LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
68
76
= help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
69
77
= note: `transmute` is only allowed in constants and statics for now
70
78
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
72
80
--> $DIR/feature-gate-const_fn_transmute.rs:33:49
73
81
|
74
82
LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
75
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
83
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
76
84
|
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
80
86
81
87
error[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
83
89
|
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
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86
92
|
87
93
= note: see issue #53605 <https://github.com/rust-lang/rust/issues/53605> for more information
88
94
= help: add `#![feature(const_fn_transmute)]` to the crate attributes to enable
89
95
= note: `transmute` is only allowed in constants and statics for now
90
96
91
97
error[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
101
99
|
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
104
102
|
105
103
= note: consult the function's documentation for information on how to avoid undefined behavior
106
104
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
108
106
--> $DIR/feature-gate-const_fn_transmute.rs:37:54
109
107
|
110
108
LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
111
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
109
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
112
110
|
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
114
114
115
115
error: aborting due to 12 previous errors
116
116
0 commit comments