@@ -14,29 +14,56 @@ LL | Foo::func();
14
14
|
15
15
= help: add `#![feature(foo)]` to the crate attributes to enable
16
16
17
- error: `<staged_api::Unstable as staged_api::MyTrait>::func` is not yet stable as a const fn
17
+ error: const- stable function cannot use `#[feature(unstable)]`
18
18
--> $DIR/staged-api.rs:55:5
19
19
|
20
20
LL | Unstable::func();
21
21
| ^^^^^^^^^^^^^^^^
22
22
|
23
- = help: const-stable functions can only call other const-stable functions
23
+ help: if it is not part of the public API, make this function unstably const
24
+ |
25
+ LL + #[rustc_const_unstable(feature = "...", issue = "...")]
26
+ LL | const fn stable_const_context() {
27
+ |
28
+ help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
29
+ |
30
+ LL + #[rustc_allow_const_fn_unstable(unstable)]
31
+ LL | const fn stable_const_context() {
32
+ |
24
33
25
- error: `<Foo as staged_api::MyTrait>::func` is not yet stable as a const fn
34
+ error: const- stable function cannot use `#[feature(foo)]`
26
35
--> $DIR/staged-api.rs:57:5
27
36
|
28
37
LL | Foo::func();
29
38
| ^^^^^^^^^^^
30
39
|
31
- = help: const-stable functions can only call other const-stable functions
40
+ help: if it is not part of the public API, make this function unstably const
41
+ |
42
+ LL + #[rustc_const_unstable(feature = "...", issue = "...")]
43
+ LL | const fn stable_const_context() {
44
+ |
45
+ help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
46
+ |
47
+ LL + #[rustc_allow_const_fn_unstable(foo)]
48
+ LL | const fn stable_const_context() {
49
+ |
32
50
33
- error: `const_context_not_const_stable` is not yet stable as a const fn
51
+ error: const- stable function cannot use `#[feature(foo)]`
34
52
--> $DIR/staged-api.rs:59:5
35
53
|
36
54
LL | const_context_not_const_stable()
37
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
56
|
39
- = help: const-stable functions can only call other const-stable functions
57
+ help: if it is not part of the public API, make this function unstably const
58
+ |
59
+ LL + #[rustc_const_unstable(feature = "...", issue = "...")]
60
+ LL | const fn stable_const_context() {
61
+ |
62
+ help: otherwise `#[rustc_allow_const_fn_unstable]` can be used to bypass stability checks
63
+ |
64
+ LL + #[rustc_allow_const_fn_unstable(foo)]
65
+ LL | const fn stable_const_context() {
66
+ |
40
67
41
68
error: aborting due to 5 previous errors
42
69
0 commit comments