Skip to content

Commit 05ca6ae

Browse files
committed
fix rustc_const_stable_indirect message
1 parent d61b343 commit 05ca6ae

7 files changed

+16
-16
lines changed

compiler/rustc_middle/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ middle_const_not_used_in_type_alias =
5252
5353
middle_const_unstable_in_const_stable_exposed =
5454
const function that might be (indirectly) exposed to stable cannot use `#[feature({$gate})]`
55-
.is_function_call = mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
55+
.is_function_call = mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
5656
.unstable_sugg = if the {$is_function_call2 ->
5757
[true] caller
5858
*[false] function

tests/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
44
LL | const fn bar() -> u32 { foo() }
55
| ^^^^^
66
|
7-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
7+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
88
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
99
|
1010
LL + #[rustc_const_unstable(feature = "...", issue = "...")]

tests/ui/consts/min_const_fn/min_const_fn_libstd_stability.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
44
LL | const fn bar() -> u32 { foo() }
55
| ^^^^^
66
|
7-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
7+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
88
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
99
|
1010
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -22,7 +22,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
2222
LL | const fn bar2() -> u32 { foo2() }
2323
| ^^^^^^
2424
|
25-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
25+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
2626
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
2727
|
2828
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -57,7 +57,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
5757
LL | foo()
5858
| ^^^^^
5959
|
60-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
60+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
6161
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
6262
|
6363
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -75,7 +75,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
7575
LL | const fn bar2_gated() -> u32 { foo2_gated() }
7676
| ^^^^^^^^^^^^
7777
|
78-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
78+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
7979
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
8080
|
8181
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -93,7 +93,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
9393
LL | pub(crate) const fn bar2_gated_stable_indirect() -> u32 { super::foo2_gated() }
9494
| ^^^^^^^^^^^^^^^^^^^
9595
|
96-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
96+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
9797
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
9898
|
9999
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -111,7 +111,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
111111
LL | const fn stable_indirect() -> u32 { foo2_gated() }
112112
| ^^^^^^^^^^^^
113113
|
114-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
114+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
115115
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
116116
|
117117
LL + #[rustc_const_unstable(feature = "...", issue = "...")]

tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
44
LL | const unsafe fn bar() -> u32 { unsafe { foo() } }
55
| ^^^^^
66
|
7-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
7+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
88
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
99
|
1010
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -22,7 +22,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
2222
LL | const unsafe fn bar2() -> u32 { unsafe { foo2() } }
2323
| ^^^^^^
2424
|
25-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
25+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
2626
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
2727
|
2828
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -40,7 +40,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
4040
LL | const unsafe fn bar2_gated() -> u32 { unsafe { foo2_gated() } }
4141
| ^^^^^^^^^^^^
4242
|
43-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
43+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
4444
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
4545
|
4646
LL + #[rustc_const_unstable(feature = "...", issue = "...")]

tests/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
44
LL | const unsafe fn bar() -> u32 { foo() }
55
| ^^^^^
66
|
7-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
7+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
88
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
99
|
1010
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -22,7 +22,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
2222
LL | const unsafe fn bar2() -> u32 { foo2() }
2323
| ^^^^^^
2424
|
25-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
25+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
2626
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
2727
|
2828
LL + #[rustc_const_unstable(feature = "...", issue = "...")]
@@ -40,7 +40,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
4040
LL | const unsafe fn bar2_gated() -> u32 { foo2_gated() }
4141
| ^^^^^^^^^^^^
4242
|
43-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
43+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
4444
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
4545
|
4646
LL + #[rustc_const_unstable(feature = "...", issue = "...")]

tests/ui/consts/min_const_fn/recursive_const_stab_unmarked_crate_imports.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
44
LL | unstable_if_unmarked_const_fn_crate::not_stably_const();
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
7+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
88
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
99
|
1010
LL + #[rustc_const_unstable(feature = "...", issue = "...")]

tests/ui/consts/min_const_fn/recursive_const_stab_unstable_if_unmarked.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: const function that might be (indirectly) exposed to stable cannot use `#
44
LL | not_stably_const();
55
| ^^^^^^^^^^^^^^^^^^
66
|
7-
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unsafe features
7+
= help: mark the callee as `#[rustc_const_stable_indirect]` if it does not itself require any unstable features
88
help: if the caller is not (yet) meant to be exposed to stable, add `#[rustc_const_unstable]` (this is what you probably want to do)
99
|
1010
LL + #[rustc_const_unstable(feature = "...", issue = "...")]

0 commit comments

Comments
 (0)