Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak wording in feature gate errors #62646

Merged
merged 2 commits into from
Jul 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
34 changes: 17 additions & 17 deletions src/test/ui/feature-gates/feature-gate-custom_attribute2.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0658]: The attribute `lt_struct` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `lt_struct` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:6:13
|
LL | struct StLt<#[lt_struct] 'a>(&'a u32);
Expand All @@ -7,7 +7,7 @@ LL | struct StLt<#[lt_struct] 'a>(&'a u32);
= 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 `ty_struct` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `ty_struct` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:8:13
|
LL | struct StTy<#[ty_struct] I>(I);
Expand All @@ -16,7 +16,7 @@ LL | struct StTy<#[ty_struct] I>(I);
= 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 `lt_enum` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `lt_enum` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:11:11
|
LL | enum EnLt<#[lt_enum] 'b> { A(&'b u32), B }
Expand All @@ -25,7 +25,7 @@ LL | enum EnLt<#[lt_enum] 'b> { A(&'b u32), B }
= 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 `ty_enum` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `ty_enum` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:13:11
|
LL | enum EnTy<#[ty_enum] J> { A(J), B }
Expand All @@ -34,7 +34,7 @@ LL | enum EnTy<#[ty_enum] J> { A(J), B }
= 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 `lt_trait` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `lt_trait` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:16:12
|
LL | trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
Expand All @@ -43,7 +43,7 @@ LL | trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
= 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 `ty_trait` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `ty_trait` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:18:12
|
LL | trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); }
Expand All @@ -52,7 +52,7 @@ LL | trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); }
= 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 `lt_type` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `lt_type` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:21:11
|
LL | type TyLt<#[lt_type] 'd> = &'d u32;
Expand All @@ -61,7 +61,7 @@ LL | type TyLt<#[lt_type] 'd> = &'d u32;
= 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 `ty_type` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `ty_type` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:23:11
|
LL | type TyTy<#[ty_type] L> = (L, );
Expand All @@ -70,7 +70,7 @@ LL | type TyTy<#[ty_type] L> = (L, );
= 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 `lt_inherent` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `lt_inherent` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:26:6
|
LL | impl<#[lt_inherent] 'e> StLt<'e> { }
Expand All @@ -79,7 +79,7 @@ LL | impl<#[lt_inherent] 'e> StLt<'e> { }
= 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 `ty_inherent` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `ty_inherent` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:28:6
|
LL | impl<#[ty_inherent] M> StTy<M> { }
Expand All @@ -88,7 +88,7 @@ LL | impl<#[ty_inherent] M> StTy<M> { }
= 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 `lt_impl_for` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `lt_impl_for` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:31:6
|
LL | impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'f> {
Expand All @@ -97,7 +97,7 @@ LL | impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'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 `ty_impl_for` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `ty_impl_for` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:35:6
|
LL | impl<#[ty_impl_for] N> TrTy<N> for StTy<N> {
Expand All @@ -106,7 +106,7 @@ LL | impl<#[ty_impl_for] N> TrTy<N> for StTy<N> {
= 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 `lt_fn` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `lt_fn` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:40:9
|
LL | fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
Expand All @@ -115,7 +115,7 @@ LL | fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
= 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 `ty_fn` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `ty_fn` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:42:9
|
LL | fn f_ty<#[ty_fn] O>(_: O) { }
Expand All @@ -124,7 +124,7 @@ LL | fn f_ty<#[ty_fn] O>(_: O) { }
= 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 `lt_meth` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `lt_meth` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:46:13
|
LL | fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
Expand All @@ -133,7 +133,7 @@ LL | fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
= 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 `ty_meth` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `ty_meth` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:48:13
|
LL | fn m_ty<#[ty_meth] P>(_: P) { }
Expand All @@ -142,7 +142,7 @@ LL | fn m_ty<#[ty_meth] P>(_: P) { }
= 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 `lt_hof` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `lt_hof` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute2.rs:53:19
|
LL | where Q: for <#[lt_hof] 'i> Fn(&'i [u32]) -> &'i u32
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/feature-gates/feature-gate-may-dangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/feature-gates/feature-gate-may-dangle.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0658]: may_dangle has unstable semantics and may be removed in the future
error[E0658]: `may_dangle` has unstable semantics and may be removed in the future
--> $DIR/feature-gate-may-dangle.rs:6:13
|
LL | unsafe impl<#[may_dangle] A> Drop for Pt<A> {
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/proc-macro/proc-macro-gates2.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0658]: The attribute `empty_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `empty_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/proc-macro-gates2.rs:12:11
|
LL | fn _test6<#[empty_attr] T>() {}
Expand All @@ -7,7 +7,7 @@ LL | fn _test6<#[empty_attr] 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 `empty_attr` is currently unknown to the compiler and may have meaning added to it in the future
error[E0658]: the attribute `empty_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/proc-macro-gates2.rs:17:9
|
LL | #[empty_attr]
Expand Down
Loading