@@ -37,6 +37,7 @@ LL | foo4() //~ ERROR not allowed in const fn
37
37
| ^^^^^^ call to unsafe function
38
38
|
39
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`.
40
41
41
42
error: call to unsafe function is unsafe and unsafe operations are not allowed in const fn
42
43
--> $DIR/min_const_fn_unsafe_feature_gate.rs:42:5
@@ -45,6 +46,7 @@ LL | foo5::<String>() //~ ERROR not allowed in const fn
45
46
| ^^^^^^^^^^^^^^^^ call to unsafe function
46
47
|
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`.
48
50
49
51
error: call to unsafe function is unsafe and unsafe operations are not allowed in const fn
50
52
--> $DIR/min_const_fn_unsafe_feature_gate.rs:45:5
@@ -53,6 +55,7 @@ LL | foo6::<Vec<std::cell::Cell<u32>>>() //~ ERROR not allowed in const fn
53
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
54
56
|
55
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`.
56
59
57
60
error: dereference of raw pointer is unsafe and unsafe operations are not allowed in const fn
58
61
--> $DIR/min_const_fn_unsafe_feature_gate.rs:47:51
@@ -61,6 +64,7 @@ LL | const unsafe fn foo30_3(x: *mut usize) -> usize { *x } //~ ERROR not allowe
61
64
| ^^ dereference of raw pointer
62
65
|
63
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`.
64
68
65
69
error: dereference of raw pointer is unsafe and unsafe operations are not allowed in const fn
66
70
--> $DIR/min_const_fn_unsafe_feature_gate.rs:50:60
@@ -69,6 +73,7 @@ LL | const unsafe fn foo30_4(x: *mut usize) -> &'static usize { &*x } //~ ERROR
69
73
| ^^^ dereference of raw pointer
70
74
|
71
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`.
72
77
73
78
error: dereference of raw pointer is unsafe and unsafe operations are not allowed in const fn
74
79
--> $DIR/min_const_fn_unsafe_feature_gate.rs:53:62
@@ -85,6 +90,7 @@ LL | Foo { x: () }.y //~ ERROR not allowed in const fn
85
90
| ^^^^^^^^^^^^^^^ access to union field
86
91
|
87
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`.
88
94
89
95
error: aborting due to 11 previous errors
90
96
0 commit comments