Skip to content

Commit 421b93d

Browse files
committed
Add test
1 parent 7ad23f4 commit 421b93d

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![allow(internal_features)]
2+
#![feature(staged_api)]
3+
#![unstable(feature = "foo", issue = "none" )]
4+
5+
#[unstable_feature_bound(foo)]
6+
#[unstable(feature = "foo", issue = "none" )]
7+
pub trait Foo {
8+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//@ aux-build:unstable_feature_bound_on_trait.rs
2+
3+
extern crate unstable_feature_bound_on_trait as aux;
4+
//~^ ERROR: use of unstable library feature `foo`
5+
use aux::Foo;
6+
//~^ ERROR: use of unstable library feature `foo`
7+
8+
struct Bar{}
9+
10+
impl Foo for Bar {
11+
//~^ ERROR: use of unstable library feature `foo`
12+
//~^^ ERROR: use of unstable library feature `foo`
13+
}
14+
15+
fn main() {
16+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
error[E0658]: use of unstable library feature `foo`
2+
--> $DIR/unstable_feature_bound_on_trait_error_message.rs:3:1
3+
|
4+
LL | extern crate unstable_feature_bound_on_trait as aux;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= help: add `#![feature(foo)]` to the crate attributes to enable
8+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
9+
10+
error[E0658]: use of unstable library feature `foo`
11+
--> $DIR/unstable_feature_bound_on_trait_error_message.rs:5:5
12+
|
13+
LL | use aux::Foo;
14+
| ^^^^^^^^
15+
|
16+
= help: add `#![feature(foo)]` to the crate attributes to enable
17+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
18+
19+
error[E0658]: use of unstable library feature `foo`
20+
--> $DIR/unstable_feature_bound_on_trait_error_message.rs:10:6
21+
|
22+
LL | impl Foo for Bar {
23+
| ^^^
24+
|
25+
= help: add `#![feature(foo)]` to the crate attributes to enable
26+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
27+
28+
error[E0658]: use of unstable library feature `foo`
29+
--> $DIR/unstable_feature_bound_on_trait_error_message.rs:10:6
30+
|
31+
LL | impl Foo for Bar {
32+
| ^^^
33+
|
34+
= help: add `#![feature(foo)]` to the crate attributes to enable
35+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
36+
note: required by a bound in `Foo`
37+
--> $DIR/auxiliary/unstable_feature_bound_on_trait.rs:5:1
38+
|
39+
LL | #[unstable_feature_bound(foo)]
40+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Foo`
41+
LL | #[unstable(feature = "foo", issue = "none" )]
42+
LL | pub trait Foo {
43+
| --- required by a bound in this trait
44+
45+
error: aborting due to 4 previous errors
46+
47+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)