Skip to content

Commit 84dfb2c

Browse files
committed
Tweak wording in feature gate errors
1 parent e13fe7f commit 84dfb2c

32 files changed

+109
-109
lines changed

src/librustc_resolve/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl<'a> Resolver<'a> {
328328
if attr_kind == NonMacroAttrKind::Custom {
329329
assert!(path.segments.len() == 1);
330330
if !features.custom_attribute {
331-
let msg = format!("The attribute `{}` is currently unknown to the \
331+
let msg = format!("the attribute `{}` is currently unknown to the \
332332
compiler and may have meaning added to it in the \
333333
future", path);
334334
self.report_unknown_attribute(

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/attributes/obsolete-attr.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: The attribute `fixed_stack_segment` is currently unknown to the compiler and may have meaning added to it in the future
1+
error[E0658]: the attribute `fixed_stack_segment` is currently unknown to the compiler and may have meaning added to it in the future
22
--> $DIR/obsolete-attr.rs:5:3
33
|
44
LL | #[fixed_stack_segment] fn f() {}
@@ -7,7 +7,7 @@ LL | #[fixed_stack_segment] fn f() {}
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 `ab_isize` is currently unknown to the compiler and may have meaning added to it in the future
10+
error[E0658]: the attribute `ab_isize` is currently unknown to the compiler and may have meaning added to it in the future
1111
--> $DIR/obsolete-attr.rs:3:3
1212
|
1313
LL | #[ab_isize="stdcall"] extern {}

src/test/ui/attributes/unknown-attr.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: The attribute `mutable_doc` is currently unknown to the compiler and may have meaning added to it in the future
1+
error[E0658]: the attribute `mutable_doc` is currently unknown to the compiler and may have meaning added to it in the future
22
--> $DIR/unknown-attr.rs:5:4
33
|
44
LL | #![mutable_doc]
@@ -7,7 +7,7 @@ LL | #![mutable_doc]
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 `dance` is currently unknown to the compiler and may have meaning added to it in the future
10+
error[E0658]: the attribute `dance` is currently unknown to the compiler and may have meaning added to it in the future
1111
--> $DIR/unknown-attr.rs:7:3
1212
|
1313
LL | #[dance] mod a {}
@@ -16,7 +16,7 @@ LL | #[dance] mod a {}
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 `dance` is currently unknown to the compiler and may have meaning added to it in the future
19+
error[E0658]: the attribute `dance` is currently unknown to the compiler and may have meaning added to it in the future
2020
--> $DIR/unknown-attr.rs:9:3
2121
|
2222
LL | #[dance] fn main() {}

src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: The attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
1+
error[E0658]: the attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
22
--> $DIR/cfg-attr-unknown-attribute-macro-expansion.rs:3:27
33
|
44
LL | #[cfg_attr(all(), unknown)]

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/custom_attribute.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#![feature(stmt_expr_attributes)]
22

3-
#[foo] //~ ERROR The attribute `foo`
3+
#[foo] //~ ERROR the attribute `foo`
44
fn main() {
5-
#[foo] //~ ERROR The attribute `foo`
5+
#[foo] //~ ERROR the attribute `foo`
66
let x = ();
7-
#[foo] //~ ERROR The attribute `foo`
7+
#[foo] //~ ERROR the attribute `foo`
88
x
99
}

src/test/ui/custom_attribute.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
1+
error[E0658]: the attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
22
--> $DIR/custom_attribute.rs:3:3
33
|
44
LL | #[foo]
@@ -7,7 +7,7 @@ LL | #[foo]
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 `foo` is currently unknown to the compiler and may have meaning added to it in the future
10+
error[E0658]: the attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
1111
--> $DIR/custom_attribute.rs:5:7
1212
|
1313
LL | #[foo]
@@ -16,7 +16,7 @@ LL | #[foo]
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 `foo` is currently unknown to the compiler and may have meaning added to it in the future
19+
error[E0658]: the attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
2020
--> $DIR/custom_attribute.rs:7:7
2121
|
2222
LL | #[foo]

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
1+
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
22
--> $DIR/feature-gate-custom_attribute.rs:7:3
33
|
44
LL | #[fake_attr]
@@ -7,7 +7,7 @@ LL | #[fake_attr]
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 `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
10+
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
1111
--> $DIR/feature-gate-custom_attribute.rs:8:3
1212
|
1313
LL | #[fake_attr(100)]
@@ -16,7 +16,7 @@ LL | #[fake_attr(100)]
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 `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
19+
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
2020
--> $DIR/feature-gate-custom_attribute.rs:9:3
2121
|
2222
LL | #[fake_attr(1, 2, 3)]
@@ -25,7 +25,7 @@ LL | #[fake_attr(1, 2, 3)]
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 `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
28+
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
2929
--> $DIR/feature-gate-custom_attribute.rs:10:3
3030
|
3131
LL | #[fake_attr("hello")]
@@ -34,7 +34,7 @@ LL | #[fake_attr("hello")]
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 `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
37+
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
3838
--> $DIR/feature-gate-custom_attribute.rs:11:3
3939
|
4040
LL | #[fake_attr(name = "hello")]
@@ -43,7 +43,7 @@ LL | #[fake_attr(name = "hello")]
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 `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
46+
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
4747
--> $DIR/feature-gate-custom_attribute.rs:12:3
4848
|
4949
LL | #[fake_attr(1, "hi", key = 12, true, false)]
@@ -52,7 +52,7 @@ LL | #[fake_attr(1, "hi", key = 12, true, false)]
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 `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
55+
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
5656
--> $DIR/feature-gate-custom_attribute.rs:13:3
5757
|
5858
LL | #[fake_attr(key = "hello", val = 10)]
@@ -61,7 +61,7 @@ LL | #[fake_attr(key = "hello", val = 10)]
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 `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
64+
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
6565
--> $DIR/feature-gate-custom_attribute.rs:14:3
6666
|
6767
LL | #[fake_attr(key("hello"), val(10))]
@@ -70,7 +70,7 @@ LL | #[fake_attr(key("hello"), val(10))]
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 `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
73+
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
7474
--> $DIR/feature-gate-custom_attribute.rs:15:3
7575
|
7676
LL | #[fake_attr(enabled = true, disabled = false)]
@@ -79,7 +79,7 @@ LL | #[fake_attr(enabled = true, disabled = false)]
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 `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
82+
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
8383
--> $DIR/feature-gate-custom_attribute.rs:16:3
8484
|
8585
LL | #[fake_attr(true)]
@@ -88,7 +88,7 @@ LL | #[fake_attr(true)]
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 `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
91+
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
9292
--> $DIR/feature-gate-custom_attribute.rs:17:3
9393
|
9494
LL | #[fake_attr(pi = 3.14159)]
@@ -97,7 +97,7 @@ LL | #[fake_attr(pi = 3.14159)]
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 `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
100+
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
101101
--> $DIR/feature-gate-custom_attribute.rs:18:3
102102
|
103103
LL | #[fake_attr(b"hi")]
@@ -106,7 +106,7 @@ LL | #[fake_attr(b"hi")]
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 `fake_doc` is currently unknown to the compiler and may have meaning added to it in the future
109+
error[E0658]: the attribute `fake_doc` is currently unknown to the compiler and may have meaning added to it in the future
110110
--> $DIR/feature-gate-custom_attribute.rs:19:3
111111
|
112112
LL | #[fake_doc(r"doc")]

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

0 commit comments

Comments
 (0)