Skip to content

Commit 1c1bfba

Browse files
committed
Add test for unstable trait impl lint.
1 parent 471fb62 commit 1c1bfba

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#![feature(staged_api)]
2+
3+
#[stable(feature = "x", since = "1")]
4+
struct StableType;
5+
6+
#[unstable(feature = "x", issue = "none")]
7+
struct UnstableType;
8+
9+
#[stable(feature = "x", since = "1")]
10+
trait StableTrait {}
11+
12+
#[unstable(feature = "x", issue = "none")]
13+
trait UnstableTrait {}
14+
15+
#[unstable(feature = "x", issue = "none")]
16+
impl UnstableTrait for UnstableType {}
17+
18+
#[unstable(feature = "x", issue = "none")]
19+
impl StableTrait for UnstableType {}
20+
21+
#[unstable(feature = "x", issue = "none")]
22+
impl UnstableTrait for StableType {}
23+
24+
#[unstable(feature = "x", issue = "none")]
25+
//~^ ERROR An `#[unstable]` annotation here has no effect.
26+
impl StableTrait for StableType {}
27+
28+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: An `#[unstable]` annotation here has no effect. See issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information.
2+
--> $DIR/stability-attribute-trait-impl.rs:24:1
3+
|
4+
LL | #[unstable(feature = "x", issue = "none")]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: `#[deny(rustc::ineffective_unstable_trait_impl)]` on by default
8+
9+
error: aborting due to previous error
10+

0 commit comments

Comments
 (0)