|
1 | 1 | error[E0658]: dereferencing raw pointers in constant functions is unstable (see issue #51911)
|
2 |
| - --> $DIR/min_const_fn_unsafe_feature_gate.rs:47:51 |
| 2 | + --> $DIR/min_const_fn_unsafe_feature_gate.rs:46:51 |
3 | 3 | |
|
4 |
| -LL | const unsafe fn foo30_3(x: *mut usize) -> usize { *x } //~ ERROR not allowed in const fn |
| 4 | +LL | const unsafe fn foo30_3(x: *mut usize) -> usize { *x } |
5 | 5 | | ^^
|
6 | 6 | |
|
7 | 7 | = help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
|
8 | 8 |
|
9 | 9 | error[E0658]: dereferencing raw pointers in constant functions is unstable (see issue #51911)
|
10 |
| - --> $DIR/min_const_fn_unsafe_feature_gate.rs:50:60 |
| 10 | + --> $DIR/min_const_fn_unsafe_feature_gate.rs:49:60 |
11 | 11 | |
|
12 |
| -LL | const unsafe fn foo30_4(x: *mut usize) -> &'static usize { &*x } //~ ERROR not allowed in const fn |
| 12 | +LL | const unsafe fn foo30_4(x: *mut usize) -> &'static usize { &*x } |
13 | 13 | | ^^^
|
14 | 14 | |
|
15 | 15 | = help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
|
16 | 16 |
|
17 | 17 | error[E0658]: dereferencing raw pointers in constant functions is unstable (see issue #51911)
|
18 |
| - --> $DIR/min_const_fn_unsafe_feature_gate.rs:53:62 |
| 18 | + --> $DIR/min_const_fn_unsafe_feature_gate.rs:52:62 |
19 | 19 | |
|
20 |
| -LL | const fn foo30_5(x: *mut usize) -> &'static usize { unsafe { &*x } } //~ ERROR not allowed |
| 20 | +LL | const fn foo30_5(x: *mut usize) -> &'static usize { unsafe { &*x } } //~ is unsafe |
21 | 21 | | ^^^
|
22 | 22 | |
|
23 | 23 | = help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
|
24 | 24 |
|
25 | 25 | error[E0658]: unions in const fn are unstable (see issue #51909)
|
26 |
| - --> $DIR/min_const_fn_unsafe_feature_gate.rs:60:5 |
| 26 | + --> $DIR/min_const_fn_unsafe_feature_gate.rs:59:5 |
27 | 27 | |
|
28 |
| -LL | Foo { x: () }.y //~ ERROR not allowed in const fn |
| 28 | +LL | Foo { x: () }.y |
29 | 29 | | ^^^^^^^^^^^^^^^
|
30 | 30 | |
|
31 | 31 | = help: add #![feature(const_fn_union)] to the crate attributes to enable
|
32 | 32 |
|
33 |
| -error: call to unsafe function is unsafe and unsafe operations are not allowed in const fn |
34 |
| - --> $DIR/min_const_fn_unsafe_feature_gate.rs:39:5 |
| 33 | +error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block |
| 34 | + --> $DIR/min_const_fn_unsafe_feature_gate.rs:52:62 |
35 | 35 | |
|
36 |
| -LL | foo4() //~ ERROR not allowed in const fn |
37 |
| - | ^^^^^^ call to unsafe function |
38 |
| - | |
39 |
| - = note: consult the function's documentation for information on how to avoid undefined behavior |
40 |
| - = note: unsafe action within a `const unsafe fn` still require an `unsafe` block in contrast to regular `unsafe fn`. |
41 |
| - |
42 |
| -error: call to unsafe function is unsafe and unsafe operations are not allowed in const fn |
43 |
| - --> $DIR/min_const_fn_unsafe_feature_gate.rs:42:5 |
44 |
| - | |
45 |
| -LL | foo5::<String>() //~ ERROR not allowed in const fn |
46 |
| - | ^^^^^^^^^^^^^^^^ call to unsafe function |
47 |
| - | |
48 |
| - = note: consult the function's documentation for information on how to avoid undefined behavior |
49 |
| - = note: unsafe action within a `const unsafe fn` still require an `unsafe` block in contrast to regular `unsafe fn`. |
50 |
| - |
51 |
| -error: call to unsafe function is unsafe and unsafe operations are not allowed in const fn |
52 |
| - --> $DIR/min_const_fn_unsafe_feature_gate.rs:45:5 |
53 |
| - | |
54 |
| -LL | foo6::<Vec<std::cell::Cell<u32>>>() //~ ERROR not allowed in const fn |
55 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function |
56 |
| - | |
57 |
| - = note: consult the function's documentation for information on how to avoid undefined behavior |
58 |
| - = note: unsafe action within a `const unsafe fn` still require an `unsafe` block in contrast to regular `unsafe fn`. |
59 |
| - |
60 |
| -error: dereference of raw pointer is unsafe and unsafe operations are not allowed in const fn |
61 |
| - --> $DIR/min_const_fn_unsafe_feature_gate.rs:47:51 |
62 |
| - | |
63 |
| -LL | const unsafe fn foo30_3(x: *mut usize) -> usize { *x } //~ ERROR not allowed in const fn |
64 |
| - | ^^ dereference of raw pointer |
65 |
| - | |
66 |
| - = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior |
67 |
| - = note: unsafe action within a `const unsafe fn` still require an `unsafe` block in contrast to regular `unsafe fn`. |
68 |
| - |
69 |
| -error: dereference of raw pointer is unsafe and unsafe operations are not allowed in const fn |
70 |
| - --> $DIR/min_const_fn_unsafe_feature_gate.rs:50:60 |
71 |
| - | |
72 |
| -LL | const unsafe fn foo30_4(x: *mut usize) -> &'static usize { &*x } //~ ERROR not allowed in const fn |
73 |
| - | ^^^ dereference of raw pointer |
74 |
| - | |
75 |
| - = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior |
76 |
| - = note: unsafe action within a `const unsafe fn` still require an `unsafe` block in contrast to regular `unsafe fn`. |
77 |
| - |
78 |
| -error: dereference of raw pointer is unsafe and unsafe operations are not allowed in const fn |
79 |
| - --> $DIR/min_const_fn_unsafe_feature_gate.rs:53:62 |
80 |
| - | |
81 |
| -LL | const fn foo30_5(x: *mut usize) -> &'static usize { unsafe { &*x } } //~ ERROR not allowed |
| 36 | +LL | const fn foo30_5(x: *mut usize) -> &'static usize { unsafe { &*x } } //~ is unsafe |
82 | 37 | | ^^^ dereference of raw pointer
|
83 | 38 | |
|
84 | 39 | = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
|
85 | 40 |
|
86 |
| -error: access to union field is unsafe and unsafe operations are not allowed in const fn |
87 |
| - --> $DIR/min_const_fn_unsafe_feature_gate.rs:60:5 |
88 |
| - | |
89 |
| -LL | Foo { x: () }.y //~ ERROR not allowed in const fn |
90 |
| - | ^^^^^^^^^^^^^^^ access to union field |
91 |
| - | |
92 |
| - = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
93 |
| - = note: unsafe action within a `const unsafe fn` still require an `unsafe` block in contrast to regular `unsafe fn`. |
94 |
| - |
95 |
| -error: aborting due to 11 previous errors |
| 41 | +error: aborting due to 5 previous errors |
96 | 42 |
|
97 |
| -For more information about this error, try `rustc --explain E0658`. |
| 43 | +Some errors occurred: E0133, E0658. |
| 44 | +For more information about an error, try `rustc --explain E0133`. |
0 commit comments