Skip to content

Commit 4efdff7

Browse files
Rollup merge of rust-lang#62646 - estebank:wording, r=petrochenkov
Tweak wording in feature gate errors
2 parents ee81940 + b7459f3 commit 4efdff7

File tree

9 files changed

+62
-62
lines changed

9 files changed

+62
-62
lines changed

src/libsyntax/feature_gate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,7 +1451,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
14511451
template!(Word),
14521452
Gated(Stability::Unstable,
14531453
sym::dropck_eyepatch,
1454-
"may_dangle has unstable semantics and may be removed in the future",
1454+
"`may_dangle` has unstable semantics and may be removed in the future",
14551455
cfg_fn!(dropck_eyepatch))),
14561456
(sym::unwind, Whitelisted, template!(List: "allowed|aborts"), Gated(Stability::Unstable,
14571457
sym::unwind_attributes,
@@ -1693,8 +1693,8 @@ impl<'a> Context<'a> {
16931693
// Only run the custom attribute lint during regular feature gate
16941694
// checking. Macro gating runs before the plugin attributes are
16951695
// registered, so we skip this in that case.
1696-
let msg = format!("The attribute `{}` is currently unknown to the compiler and \
1697-
may have meaning added to it in the future", attr.path);
1696+
let msg = format!("the attribute `{}` is currently unknown to the compiler and \
1697+
may have meaning added to it in the future", attr.path);
16981698
gate_feature!(self, custom_attribute, attr.span, &msg);
16991699
}
17001700
}

src/test/ui/conditional-compilation/cfg-generic-params.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ error: only lifetime parameters can be used in this context
1616
LL | struct WhereBad where for<#[cfg(no)] 'a, #[cfg(yes)] T> u8: Copy;
1717
| ^
1818

19-
error[E0658]: The attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
19+
error[E0658]: the attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
2020
--> $DIR/cfg-generic-params.rs:19:29
2121
|
2222
LL | fn f_lt_yes<#[cfg_attr(yes, unknown)] 'a>() {}
@@ -25,7 +25,7 @@ LL | fn f_lt_yes<#[cfg_attr(yes, unknown)] 'a>() {}
2525
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
2626
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
2727

28-
error[E0658]: The attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
28+
error[E0658]: the attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
2929
--> $DIR/cfg-generic-params.rs:21:29
3030
|
3131
LL | fn f_ty_yes<#[cfg_attr(yes, unknown)] T>() {}
@@ -34,7 +34,7 @@ LL | fn f_ty_yes<#[cfg_attr(yes, unknown)] T>() {}
3434
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
3535
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
3636

37-
error[E0658]: The attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
37+
error[E0658]: the attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
3838
--> $DIR/cfg-generic-params.rs:24:34
3939
|
4040
LL | type FnYes = for<#[cfg_attr(yes, unknown)] 'a> fn();
@@ -43,7 +43,7 @@ LL | type FnYes = for<#[cfg_attr(yes, unknown)] 'a> fn();
4343
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
4444
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
4545

46-
error[E0658]: The attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
46+
error[E0658]: the attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
4747
--> $DIR/cfg-generic-params.rs:28:40
4848
|
4949
LL | type PolyYes = dyn for<#[cfg_attr(yes, unknown)] 'a> Copy;
@@ -52,7 +52,7 @@ LL | type PolyYes = dyn for<#[cfg_attr(yes, unknown)] 'a> Copy;
5252
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
5353
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
5454

55-
error[E0658]: The attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
55+
error[E0658]: the attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
5656
--> $DIR/cfg-generic-params.rs:32:43
5757
|
5858
LL | struct WhereYes where for<#[cfg_attr(yes, unknown)] 'a> u8: Copy;

src/test/ui/feature-gates/feature-gate-custom_attribute2.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,54 @@
44
// gate-test-custom_attribute
55

66
struct StLt<#[lt_struct] 'a>(&'a u32);
7-
//~^ ERROR The attribute `lt_struct` is currently unknown to the compiler
7+
//~^ ERROR the attribute `lt_struct` is currently unknown to the compiler
88
struct StTy<#[ty_struct] I>(I);
9-
//~^ ERROR The attribute `ty_struct` is currently unknown to the compiler
9+
//~^ ERROR the attribute `ty_struct` is currently unknown to the compiler
1010

1111
enum EnLt<#[lt_enum] 'b> { A(&'b u32), B }
12-
//~^ ERROR The attribute `lt_enum` is currently unknown to the compiler
12+
//~^ ERROR the attribute `lt_enum` is currently unknown to the compiler
1313
enum EnTy<#[ty_enum] J> { A(J), B }
14-
//~^ ERROR The attribute `ty_enum` is currently unknown to the compiler
14+
//~^ ERROR the attribute `ty_enum` is currently unknown to the compiler
1515

1616
trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
17-
//~^ ERROR The attribute `lt_trait` is currently unknown to the compiler
17+
//~^ ERROR the attribute `lt_trait` is currently unknown to the compiler
1818
trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); }
19-
//~^ ERROR The attribute `ty_trait` is currently unknown to the compiler
19+
//~^ ERROR the attribute `ty_trait` is currently unknown to the compiler
2020

2121
type TyLt<#[lt_type] 'd> = &'d u32;
22-
//~^ ERROR The attribute `lt_type` is currently unknown to the compiler
22+
//~^ ERROR the attribute `lt_type` is currently unknown to the compiler
2323
type TyTy<#[ty_type] L> = (L, );
24-
//~^ ERROR The attribute `ty_type` is currently unknown to the compiler
24+
//~^ ERROR the attribute `ty_type` is currently unknown to the compiler
2525

2626
impl<#[lt_inherent] 'e> StLt<'e> { }
27-
//~^ ERROR The attribute `lt_inherent` is currently unknown to the compiler
27+
//~^ ERROR the attribute `lt_inherent` is currently unknown to the compiler
2828
impl<#[ty_inherent] M> StTy<M> { }
29-
//~^ ERROR The attribute `ty_inherent` is currently unknown to the compiler
29+
//~^ ERROR the attribute `ty_inherent` is currently unknown to the compiler
3030

3131
impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'f> {
32-
//~^ ERROR The attribute `lt_impl_for` is currently unknown to the compiler
32+
//~^ ERROR the attribute `lt_impl_for` is currently unknown to the compiler
3333
fn foo(&self, _: &'f [u32]) -> &'f u32 { loop { } }
3434
}
3535
impl<#[ty_impl_for] N> TrTy<N> for StTy<N> {
36-
//~^ ERROR The attribute `ty_impl_for` is currently unknown to the compiler
36+
//~^ ERROR the attribute `ty_impl_for` is currently unknown to the compiler
3737
fn foo(&self, _: N) { }
3838
}
3939

4040
fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
41-
//~^ ERROR The attribute `lt_fn` is currently unknown to the compiler
41+
//~^ ERROR the attribute `lt_fn` is currently unknown to the compiler
4242
fn f_ty<#[ty_fn] O>(_: O) { }
43-
//~^ ERROR The attribute `ty_fn` is currently unknown to the compiler
43+
//~^ ERROR the attribute `ty_fn` is currently unknown to the compiler
4444

4545
impl<I> StTy<I> {
4646
fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
47-
//~^ ERROR The attribute `lt_meth` is currently unknown to the compiler
47+
//~^ ERROR the attribute `lt_meth` is currently unknown to the compiler
4848
fn m_ty<#[ty_meth] P>(_: P) { }
49-
//~^ ERROR The attribute `ty_meth` is currently unknown to the compiler
49+
//~^ ERROR the attribute `ty_meth` is currently unknown to the compiler
5050
}
5151

5252
fn hof_lt<Q>(_: Q)
5353
where Q: for <#[lt_hof] 'i> Fn(&'i [u32]) -> &'i u32
54-
//~^ ERROR The attribute `lt_hof` is currently unknown to the compiler
54+
//~^ ERROR the attribute `lt_hof` is currently unknown to the compiler
5555
{
5656
}
5757

src/test/ui/feature-gates/feature-gate-custom_attribute2.stderr

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: The attribute `lt_struct` is currently unknown to the compiler and may have meaning added to it in the future
1+
error[E0658]: the attribute `lt_struct` is currently unknown to the compiler and may have meaning added to it in the future
22
--> $DIR/feature-gate-custom_attribute2.rs:6:13
33
|
44
LL | struct StLt<#[lt_struct] 'a>(&'a u32);
@@ -7,7 +7,7 @@ LL | struct StLt<#[lt_struct] 'a>(&'a u32);
77
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
88
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
99

10-
error[E0658]: The attribute `ty_struct` is currently unknown to the compiler and may have meaning added to it in the future
10+
error[E0658]: the attribute `ty_struct` is currently unknown to the compiler and may have meaning added to it in the future
1111
--> $DIR/feature-gate-custom_attribute2.rs:8:13
1212
|
1313
LL | struct StTy<#[ty_struct] I>(I);
@@ -16,7 +16,7 @@ LL | struct StTy<#[ty_struct] I>(I);
1616
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
1717
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
1818

19-
error[E0658]: The attribute `lt_enum` is currently unknown to the compiler and may have meaning added to it in the future
19+
error[E0658]: the attribute `lt_enum` is currently unknown to the compiler and may have meaning added to it in the future
2020
--> $DIR/feature-gate-custom_attribute2.rs:11:11
2121
|
2222
LL | enum EnLt<#[lt_enum] 'b> { A(&'b u32), B }
@@ -25,7 +25,7 @@ LL | enum EnLt<#[lt_enum] 'b> { A(&'b u32), B }
2525
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
2626
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
2727

28-
error[E0658]: The attribute `ty_enum` is currently unknown to the compiler and may have meaning added to it in the future
28+
error[E0658]: the attribute `ty_enum` is currently unknown to the compiler and may have meaning added to it in the future
2929
--> $DIR/feature-gate-custom_attribute2.rs:13:11
3030
|
3131
LL | enum EnTy<#[ty_enum] J> { A(J), B }
@@ -34,7 +34,7 @@ LL | enum EnTy<#[ty_enum] J> { A(J), B }
3434
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
3535
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
3636

37-
error[E0658]: The attribute `lt_trait` is currently unknown to the compiler and may have meaning added to it in the future
37+
error[E0658]: the attribute `lt_trait` is currently unknown to the compiler and may have meaning added to it in the future
3838
--> $DIR/feature-gate-custom_attribute2.rs:16:12
3939
|
4040
LL | trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
@@ -43,7 +43,7 @@ LL | trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
4343
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
4444
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
4545

46-
error[E0658]: The attribute `ty_trait` is currently unknown to the compiler and may have meaning added to it in the future
46+
error[E0658]: the attribute `ty_trait` is currently unknown to the compiler and may have meaning added to it in the future
4747
--> $DIR/feature-gate-custom_attribute2.rs:18:12
4848
|
4949
LL | trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); }
@@ -52,7 +52,7 @@ LL | trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); }
5252
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
5353
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
5454

55-
error[E0658]: The attribute `lt_type` is currently unknown to the compiler and may have meaning added to it in the future
55+
error[E0658]: the attribute `lt_type` is currently unknown to the compiler and may have meaning added to it in the future
5656
--> $DIR/feature-gate-custom_attribute2.rs:21:11
5757
|
5858
LL | type TyLt<#[lt_type] 'd> = &'d u32;
@@ -61,7 +61,7 @@ LL | type TyLt<#[lt_type] 'd> = &'d u32;
6161
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
6262
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
6363

64-
error[E0658]: The attribute `ty_type` is currently unknown to the compiler and may have meaning added to it in the future
64+
error[E0658]: the attribute `ty_type` is currently unknown to the compiler and may have meaning added to it in the future
6565
--> $DIR/feature-gate-custom_attribute2.rs:23:11
6666
|
6767
LL | type TyTy<#[ty_type] L> = (L, );
@@ -70,7 +70,7 @@ LL | type TyTy<#[ty_type] L> = (L, );
7070
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
7171
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
7272

73-
error[E0658]: The attribute `lt_inherent` is currently unknown to the compiler and may have meaning added to it in the future
73+
error[E0658]: the attribute `lt_inherent` is currently unknown to the compiler and may have meaning added to it in the future
7474
--> $DIR/feature-gate-custom_attribute2.rs:26:6
7575
|
7676
LL | impl<#[lt_inherent] 'e> StLt<'e> { }
@@ -79,7 +79,7 @@ LL | impl<#[lt_inherent] 'e> StLt<'e> { }
7979
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
8080
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
8181

82-
error[E0658]: The attribute `ty_inherent` is currently unknown to the compiler and may have meaning added to it in the future
82+
error[E0658]: the attribute `ty_inherent` is currently unknown to the compiler and may have meaning added to it in the future
8383
--> $DIR/feature-gate-custom_attribute2.rs:28:6
8484
|
8585
LL | impl<#[ty_inherent] M> StTy<M> { }
@@ -88,7 +88,7 @@ LL | impl<#[ty_inherent] M> StTy<M> { }
8888
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
8989
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
9090

91-
error[E0658]: The attribute `lt_impl_for` is currently unknown to the compiler and may have meaning added to it in the future
91+
error[E0658]: the attribute `lt_impl_for` is currently unknown to the compiler and may have meaning added to it in the future
9292
--> $DIR/feature-gate-custom_attribute2.rs:31:6
9393
|
9494
LL | impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'f> {
@@ -97,7 +97,7 @@ LL | impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'f> {
9797
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
9898
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
9999

100-
error[E0658]: The attribute `ty_impl_for` is currently unknown to the compiler and may have meaning added to it in the future
100+
error[E0658]: the attribute `ty_impl_for` is currently unknown to the compiler and may have meaning added to it in the future
101101
--> $DIR/feature-gate-custom_attribute2.rs:35:6
102102
|
103103
LL | impl<#[ty_impl_for] N> TrTy<N> for StTy<N> {
@@ -106,7 +106,7 @@ LL | impl<#[ty_impl_for] N> TrTy<N> for StTy<N> {
106106
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
107107
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
108108

109-
error[E0658]: The attribute `lt_fn` is currently unknown to the compiler and may have meaning added to it in the future
109+
error[E0658]: the attribute `lt_fn` is currently unknown to the compiler and may have meaning added to it in the future
110110
--> $DIR/feature-gate-custom_attribute2.rs:40:9
111111
|
112112
LL | fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
@@ -115,7 +115,7 @@ LL | fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
115115
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
116116
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
117117

118-
error[E0658]: The attribute `ty_fn` is currently unknown to the compiler and may have meaning added to it in the future
118+
error[E0658]: the attribute `ty_fn` is currently unknown to the compiler and may have meaning added to it in the future
119119
--> $DIR/feature-gate-custom_attribute2.rs:42:9
120120
|
121121
LL | fn f_ty<#[ty_fn] O>(_: O) { }
@@ -124,7 +124,7 @@ LL | fn f_ty<#[ty_fn] O>(_: O) { }
124124
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
125125
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
126126

127-
error[E0658]: The attribute `lt_meth` is currently unknown to the compiler and may have meaning added to it in the future
127+
error[E0658]: the attribute `lt_meth` is currently unknown to the compiler and may have meaning added to it in the future
128128
--> $DIR/feature-gate-custom_attribute2.rs:46:13
129129
|
130130
LL | fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
@@ -133,7 +133,7 @@ LL | fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
133133
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
134134
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
135135

136-
error[E0658]: The attribute `ty_meth` is currently unknown to the compiler and may have meaning added to it in the future
136+
error[E0658]: the attribute `ty_meth` is currently unknown to the compiler and may have meaning added to it in the future
137137
--> $DIR/feature-gate-custom_attribute2.rs:48:13
138138
|
139139
LL | fn m_ty<#[ty_meth] P>(_: P) { }
@@ -142,7 +142,7 @@ LL | fn m_ty<#[ty_meth] P>(_: P) { }
142142
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
143143
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
144144

145-
error[E0658]: The attribute `lt_hof` is currently unknown to the compiler and may have meaning added to it in the future
145+
error[E0658]: the attribute `lt_hof` is currently unknown to the compiler and may have meaning added to it in the future
146146
--> $DIR/feature-gate-custom_attribute2.rs:53:19
147147
|
148148
LL | where Q: for <#[lt_hof] 'i> Fn(&'i [u32]) -> &'i u32

src/test/ui/feature-gates/feature-gate-may-dangle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
struct Pt<A>(A);
66
unsafe impl<#[may_dangle] A> Drop for Pt<A> {
7-
//~^ ERROR may_dangle has unstable semantics and may be removed in the future
7+
//~^ ERROR `may_dangle` has unstable semantics and may be removed in the future
88
fn drop(&mut self) { }
99
}
1010

src/test/ui/feature-gates/feature-gate-may-dangle.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: may_dangle has unstable semantics and may be removed in the future
1+
error[E0658]: `may_dangle` has unstable semantics and may be removed in the future
22
--> $DIR/feature-gate-may-dangle.rs:6:13
33
|
44
LL | unsafe impl<#[may_dangle] A> Drop for Pt<A> {

src/test/ui/proc-macro/proc-macro-gates2.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: The attribute `empty_attr` is currently unknown to the compiler and may have meaning added to it in the future
1+
error[E0658]: the attribute `empty_attr` is currently unknown to the compiler and may have meaning added to it in the future
22
--> $DIR/proc-macro-gates2.rs:12:11
33
|
44
LL | fn _test6<#[empty_attr] T>() {}
@@ -7,7 +7,7 @@ LL | fn _test6<#[empty_attr] T>() {}
77
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
88
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
99

10-
error[E0658]: The attribute `empty_attr` is currently unknown to the compiler and may have meaning added to it in the future
10+
error[E0658]: the attribute `empty_attr` is currently unknown to the compiler and may have meaning added to it in the future
1111
--> $DIR/proc-macro-gates2.rs:17:9
1212
|
1313
LL | #[empty_attr]

0 commit comments

Comments
 (0)