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
4 LL | const unsafe fn foo30_3(x: *mut usize) -> usize { *x } //~ ERROR not allowed in const fn
7 = help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
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
12 LL | const unsafe fn foo30_4(x: *mut usize) -> &'static usize { &*x } //~ ERROR not allowed in const fn
15 = help: add #![feature(const_raw_ptr_deref)] to the crate attributes to enable
17 error[E0658]: unions in const fn are unstable (see issue #51909)
18 --> $DIR/min_const_fn_unsafe_feature_gate.rs:57:5
20 LL | Foo { x: () }.y //~ ERROR not allowed in const fn
23 = help: add #![feature(const_fn_union)] to the crate attributes to enable
25 error: call to unsafe function is unsafe and unsafe operations are not allowed in const fn
26 --> $DIR/min_const_fn_unsafe_feature_gate.rs:39:5
28 LL | foo4() //~ ERROR not allowed in const fn
29 | ^^^^^^ call to unsafe function
31 = note: consult the function's documentation for information on how to avoid undefined behavior
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:42:5
36 LL | foo5::<String>() //~ ERROR not allowed in const fn
37 | ^^^^^^^^^^^^^^^^ call to unsafe function
39 = note: consult the function's documentation for information on how to avoid undefined behavior
41 error: call to unsafe function is unsafe and unsafe operations are not allowed in const fn
42 --> $DIR/min_const_fn_unsafe_feature_gate.rs:45:5
44 LL | foo6::<Vec<std::cell::Cell<u32>>>() //~ ERROR not allowed in const fn
45 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
47 = note: consult the function's documentation for information on how to avoid undefined behavior
49 error: dereference of raw pointer is unsafe and unsafe operations are not allowed in const fn
50 --> $DIR/min_const_fn_unsafe_feature_gate.rs:47:51
52 LL | const unsafe fn foo30_3(x: *mut usize) -> usize { *x } //~ ERROR not allowed in const fn
53 | ^^ dereference of raw pointer
55 = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
57 error: dereference of raw pointer is unsafe and unsafe operations are not allowed in const fn
58 --> $DIR/min_const_fn_unsafe_feature_gate.rs:50:60
60 LL | const unsafe fn foo30_4(x: *mut usize) -> &'static usize { &*x } //~ ERROR not allowed in const fn
61 | ^^^ dereference of raw pointer
63 = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
65 error: access to union field is unsafe and unsafe operations are not allowed in const fn
66 --> $DIR/min_const_fn_unsafe_feature_gate.rs:57:5
68 LL | Foo { x: () }.y //~ ERROR not allowed in const fn
69 | ^^^^^^^^^^^^^^^ access to union field
71 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
73 error: aborting due to 9 previous errors
75 For more information about this error, try `rustc --explain E0658`.