@@ -17,15 +17,15 @@ LL | const fn bar2() -> u32 { foo2() }
17
17
error: const-stable function cannot use `#[feature(const_refs_to_cell)]`
18
18
--> $DIR/min_const_fn_libstd_stability.rs:31:5
19
19
|
20
- LL | x.get()
20
+ LL | x.get();
21
21
| ^
22
22
|
23
23
help: if it is not part of the public API, make this function unstably const
24
24
|
25
25
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
26
26
LL | const fn bar3() -> u32 {
27
27
|
28
- help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
28
+ help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks (but requires team approval)
29
29
|
30
30
LL + #[rustc_allow_const_fn_unstable(const_refs_to_cell)]
31
31
LL | const fn bar3() -> u32 {
@@ -34,19 +34,27 @@ LL | const fn bar3() -> u32 {
34
34
error[E0015]: cannot call non-const fn `Cell::<u32>::get` in constant functions
35
35
--> $DIR/min_const_fn_libstd_stability.rs:31:7
36
36
|
37
- LL | x.get()
37
+ LL | x.get();
38
38
| ^^^^^
39
39
|
40
40
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
41
41
42
+ error: `foo` is not yet stable as a const fn
43
+ --> $DIR/min_const_fn_libstd_stability.rs:34:5
44
+ |
45
+ LL | foo()
46
+ | ^^^^^
47
+ |
48
+ = help: const-stable functions can only call other const-stable functions
49
+
42
50
error: `foo2_gated` is not yet stable as a const fn
43
- --> $DIR/min_const_fn_libstd_stability.rs:43 :32
51
+ --> $DIR/min_const_fn_libstd_stability.rs:45 :32
44
52
|
45
53
LL | const fn bar2_gated() -> u32 { foo2_gated() }
46
54
| ^^^^^^^^^^^^
47
55
|
48
56
= help: const-stable functions can only call other const-stable functions
49
57
50
- error: aborting due to 5 previous errors
58
+ error: aborting due to 6 previous errors
51
59
52
60
For more information about this error, try `rustc --explain E0015`.
0 commit comments