]> git.proxmox.com Git - rustc.git/blob - src/test/ui/feature-gates/feature-gate-const_fn_transmute.stderr
New upstream version 1.53.0+dfsg1
[rustc.git] / src / test / ui / feature-gates / feature-gate-const_fn_transmute.stderr
1 error[E0658]: `transmute` is not allowed in constant functions
2 --> $DIR/feature-gate-const_fn_transmute.rs:8:43
3 |
4 LL | const fn transmute_fn() -> u32 { unsafe { mem::transmute(Foo(3)) } }
5 | ^^^^^^^^^^^^^^^^^^^^^^
6 |
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
10
11 error[E0658]: `transmute` is not allowed in constant functions
12 --> $DIR/feature-gate-const_fn_transmute.rs:11:53
13 |
14 LL | const fn transmute_fn_intrinsic() -> u32 { unsafe { std::intrinsics::transmute(Foo(3)) } }
15 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16 |
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
20
21 error[E0658]: `transmute` is not allowed in constant functions
22 --> $DIR/feature-gate-const_fn_transmute.rs:14:58
23 |
24 LL | const fn transmute_fn_core_intrinsic() -> u32 { unsafe { core::intrinsics::transmute(Foo(3)) } }
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26 |
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
30
31 error[E0658]: `transmute` is not allowed in constant functions
32 --> $DIR/feature-gate-const_fn_transmute.rs:17:48
33 |
34 LL | const unsafe fn unsafe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
35 | ^^^^^^^^^^^^^^^^^^^^^^
36 |
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
40
41 error[E0658]: `transmute` is not allowed in constant functions
42 --> $DIR/feature-gate-const_fn_transmute.rs:20:58
43 |
44 LL | const unsafe fn unsafe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
45 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46 |
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
50
51 error[E0658]: `transmute` is not allowed in constant functions
52 --> $DIR/feature-gate-const_fn_transmute.rs:23:63
53 |
54 LL | const unsafe fn unsafe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56 |
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
60
61 error[E0658]: `transmute` is not allowed in constant functions
62 --> $DIR/feature-gate-const_fn_transmute.rs:26:39
63 |
64 LL | const fn safe_transmute_fn() -> u32 { mem::transmute(Foo(3)) }
65 | ^^^^^^^^^^^^^^^^^^^^^^
66 |
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
70
71 error[E0658]: `transmute` is not allowed in constant functions
72 --> $DIR/feature-gate-const_fn_transmute.rs:30:49
73 |
74 LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
75 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76 |
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
80
81 error[E0658]: `transmute` is not allowed in constant functions
82 --> $DIR/feature-gate-const_fn_transmute.rs:34:54
83 |
84 LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
85 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
86 |
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
90
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
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:30:49
101 |
102 LL | const fn safe_transmute_fn_intrinsic() -> u32 { std::intrinsics::transmute(Foo(3)) }
103 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
104 |
105 = note: consult the function's documentation for information on how to avoid undefined behavior
106
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
109 |
110 LL | const fn safe_transmute_fn_core_intrinsic() -> u32 { core::intrinsics::transmute(Foo(3)) }
111 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
112 |
113 = note: consult the function's documentation for information on how to avoid undefined behavior
114
115 error: aborting due to 12 previous errors
116
117 Some errors have detailed explanations: E0133, E0658.
118 For more information about an error, try `rustc --explain E0133`.