Skip to content

Commit

Permalink
Tweak wording in feature gate errors
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jul 13, 2019
1 parent e13fe7f commit 84dfb2c
Show file tree
Hide file tree
Showing 32 changed files with 109 additions and 109 deletions.
2 changes: 1 addition & 1 deletion src/librustc_resolve/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ impl<'a> Resolver<'a> {
if attr_kind == NonMacroAttrKind::Custom {
assert!(path.segments.len() == 1);
if !features.custom_attribute {
let msg = format!("The attribute `{}` is currently unknown to the \
let msg = format!("the attribute `{}` is currently unknown to the \
compiler and may have meaning added to it in the \
future", path);
self.report_unknown_attribute(
Expand Down
6 changes: 3 additions & 3 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
template!(Word),
Gated(Stability::Unstable,
sym::dropck_eyepatch,
"may_dangle has unstable semantics and may be removed in the future",
"`may_dangle` has unstable semantics and may be removed in the future",
cfg_fn!(dropck_eyepatch))),
(sym::unwind, Whitelisted, template!(List: "allowed|aborts"), Gated(Stability::Unstable,
sym::unwind_attributes,
Expand Down Expand Up @@ -1693,8 +1693,8 @@ impl<'a> Context<'a> {
// Only run the custom attribute lint during regular feature gate
// checking. Macro gating runs before the plugin attributes are
// registered, so we skip this in that case.
let msg = format!("The attribute `{}` is currently unknown to the compiler and \
may have meaning added to it in the future", attr.path);
let msg = format!("the attribute `{}` is currently unknown to the compiler and \
may have meaning added to it in the future", attr.path);
gate_feature!(self, custom_attribute, attr.span, &msg);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/attributes/obsolete-attr.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0658]: The attribute `fixed_stack_segment` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fixed_stack_segment` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/obsolete-attr.rs:5:3
|
LL | #[fixed_stack_segment] fn f() {}
Expand All @@ -7,7 +7,7 @@ LL | #[fixed_stack_segment] fn f() {}
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `ab_isize` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `ab_isize` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/obsolete-attr.rs:3:3
|
LL | #[ab_isize="stdcall"] extern {}
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/attributes/unknown-attr.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0658]: The attribute `mutable_doc` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `mutable_doc` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/unknown-attr.rs:5:4
|
LL | #![mutable_doc]
Expand All @@ -7,7 +7,7 @@ LL | #![mutable_doc]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `dance` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `dance` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/unknown-attr.rs:7:3
|
LL | #[dance] mod a {}
Expand All @@ -16,7 +16,7 @@ LL | #[dance] mod a {}
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `dance` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `dance` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/unknown-attr.rs:9:3
|
LL | #[dance] fn main() {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0658]: The attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/cfg-attr-unknown-attribute-macro-expansion.rs:3:27
|
LL | #[cfg_attr(all(), unknown)]
Expand Down
10 changes: 5 additions & 5 deletions src/test/ui/conditional-compilation/cfg-generic-params.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ error: only lifetime parameters can be used in this context
LL | struct WhereBad where for<#[cfg(no)] 'a, #[cfg(yes)] T> u8: Copy;
| ^

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

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

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

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

error[E0658]: The attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/cfg-generic-params.rs:32:43
|
LL | struct WhereYes where for<#[cfg_attr(yes, unknown)] 'a> u8: Copy;
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/custom_attribute.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![feature(stmt_expr_attributes)]

#[foo] //~ ERROR The attribute `foo`
#[foo] //~ ERROR the attribute `foo`
fn main() {
#[foo] //~ ERROR The attribute `foo`
#[foo] //~ ERROR the attribute `foo`
let x = ();
#[foo] //~ ERROR The attribute `foo`
#[foo] //~ ERROR the attribute `foo`
x
}
6 changes: 3 additions & 3 deletions src/test/ui/custom_attribute.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/custom_attribute.rs:3:3
|
LL | #[foo]
Expand All @@ -7,7 +7,7 @@ LL | #[foo]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/custom_attribute.rs:5:7
|
LL | #[foo]
Expand All @@ -16,7 +16,7 @@ LL | #[foo]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/custom_attribute.rs:7:7
|
LL | #[foo]
Expand Down
26 changes: 13 additions & 13 deletions src/test/ui/feature-gates/feature-gate-custom_attribute.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:7:3
|
LL | #[fake_attr]
Expand All @@ -7,7 +7,7 @@ LL | #[fake_attr]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:8:3
|
LL | #[fake_attr(100)]
Expand All @@ -16,7 +16,7 @@ LL | #[fake_attr(100)]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:9:3
|
LL | #[fake_attr(1, 2, 3)]
Expand All @@ -25,7 +25,7 @@ LL | #[fake_attr(1, 2, 3)]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:10:3
|
LL | #[fake_attr("hello")]
Expand All @@ -34,7 +34,7 @@ LL | #[fake_attr("hello")]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:11:3
|
LL | #[fake_attr(name = "hello")]
Expand All @@ -43,7 +43,7 @@ LL | #[fake_attr(name = "hello")]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:12:3
|
LL | #[fake_attr(1, "hi", key = 12, true, false)]
Expand All @@ -52,7 +52,7 @@ LL | #[fake_attr(1, "hi", key = 12, true, false)]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:13:3
|
LL | #[fake_attr(key = "hello", val = 10)]
Expand All @@ -61,7 +61,7 @@ LL | #[fake_attr(key = "hello", val = 10)]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:14:3
|
LL | #[fake_attr(key("hello"), val(10))]
Expand All @@ -70,7 +70,7 @@ LL | #[fake_attr(key("hello"), val(10))]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:15:3
|
LL | #[fake_attr(enabled = true, disabled = false)]
Expand All @@ -79,7 +79,7 @@ LL | #[fake_attr(enabled = true, disabled = false)]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:16:3
|
LL | #[fake_attr(true)]
Expand All @@ -88,7 +88,7 @@ LL | #[fake_attr(true)]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:17:3
|
LL | #[fake_attr(pi = 3.14159)]
Expand All @@ -97,7 +97,7 @@ LL | #[fake_attr(pi = 3.14159)]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:18:3
|
LL | #[fake_attr(b"hi")]
Expand All @@ -106,7 +106,7 @@ LL | #[fake_attr(b"hi")]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable

error[E0658]: The attribute `fake_doc` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `fake_doc` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:19:3
|
LL | #[fake_doc(r"doc")]
Expand Down
34 changes: 17 additions & 17 deletions src/test/ui/feature-gates/feature-gate-custom_attribute2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,54 @@
// gate-test-custom_attribute

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

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

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

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

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

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

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

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

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

Expand Down
Loading

0 comments on commit 84dfb2c

Please sign in to comment.