diff --git a/tests/ui/unstable-feature-bound/auxiliary/unstable_feature_bound_on_trait.rs b/tests/ui/unstable-feature-bound/auxiliary/unstable_feature_bound_on_trait.rs new file mode 100644 index 0000000000000..155d404991700 --- /dev/null +++ b/tests/ui/unstable-feature-bound/auxiliary/unstable_feature_bound_on_trait.rs @@ -0,0 +1,8 @@ +#![allow(internal_features)] +#![feature(staged_api)] +#![unstable(feature = "foo", issue = "none" )] + +#[unstable_feature_bound(foo)] +#[unstable(feature = "foo", issue = "none" )] +pub trait Foo { +} diff --git a/tests/ui/unstable-feature-bound/unstable_feature_bound_on_trait_error_message.rs b/tests/ui/unstable-feature-bound/unstable_feature_bound_on_trait_error_message.rs new file mode 100644 index 0000000000000..4e709594b154a --- /dev/null +++ b/tests/ui/unstable-feature-bound/unstable_feature_bound_on_trait_error_message.rs @@ -0,0 +1,16 @@ +//@ aux-build:unstable_feature_bound_on_trait.rs + +extern crate unstable_feature_bound_on_trait as aux; +//~^ ERROR: use of unstable library feature `foo` +use aux::Foo; +//~^ ERROR: use of unstable library feature `foo` + +struct Bar{} + +impl Foo for Bar { +//~^ ERROR: use of unstable library feature `foo` +//~^^ ERROR: use of unstable library feature `foo` +} + +fn main() { +} diff --git a/tests/ui/unstable-feature-bound/unstable_feature_bound_on_trait_error_message.stderr b/tests/ui/unstable-feature-bound/unstable_feature_bound_on_trait_error_message.stderr new file mode 100644 index 0000000000000..ca295ce13da61 --- /dev/null +++ b/tests/ui/unstable-feature-bound/unstable_feature_bound_on_trait_error_message.stderr @@ -0,0 +1,47 @@ +error[E0658]: use of unstable library feature `foo` + --> $DIR/unstable_feature_bound_on_trait_error_message.rs:3:1 + | +LL | extern crate unstable_feature_bound_on_trait as aux; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add `#![feature(foo)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `foo` + --> $DIR/unstable_feature_bound_on_trait_error_message.rs:5:5 + | +LL | use aux::Foo; + | ^^^^^^^^ + | + = help: add `#![feature(foo)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `foo` + --> $DIR/unstable_feature_bound_on_trait_error_message.rs:10:6 + | +LL | impl Foo for Bar { + | ^^^ + | + = help: add `#![feature(foo)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `foo` + --> $DIR/unstable_feature_bound_on_trait_error_message.rs:10:6 + | +LL | impl Foo for Bar { + | ^^^ + | + = help: add `#![feature(foo)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +note: required by a bound in `Foo` + --> $DIR/auxiliary/unstable_feature_bound_on_trait.rs:5:1 + | +LL | #[unstable_feature_bound(foo)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Foo` +LL | #[unstable(feature = "foo", issue = "none" )] +LL | pub trait Foo { + | --- required by a bound in this trait + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0658`.