Add test for unstable trait impl lint.
This commit is contained in:
parent
471fb622aa
commit
1c1bfba84a
|
@ -0,0 +1,28 @@
|
|||
#![feature(staged_api)]
|
||||
|
||||
#[stable(feature = "x", since = "1")]
|
||||
struct StableType;
|
||||
|
||||
#[unstable(feature = "x", issue = "none")]
|
||||
struct UnstableType;
|
||||
|
||||
#[stable(feature = "x", since = "1")]
|
||||
trait StableTrait {}
|
||||
|
||||
#[unstable(feature = "x", issue = "none")]
|
||||
trait UnstableTrait {}
|
||||
|
||||
#[unstable(feature = "x", issue = "none")]
|
||||
impl UnstableTrait for UnstableType {}
|
||||
|
||||
#[unstable(feature = "x", issue = "none")]
|
||||
impl StableTrait for UnstableType {}
|
||||
|
||||
#[unstable(feature = "x", issue = "none")]
|
||||
impl UnstableTrait for StableType {}
|
||||
|
||||
#[unstable(feature = "x", issue = "none")]
|
||||
//~^ ERROR An `#[unstable]` annotation here has no effect.
|
||||
impl StableTrait for StableType {}
|
||||
|
||||
fn main() {}
|
|
@ -0,0 +1,10 @@
|
|||
error: An `#[unstable]` annotation here has no effect. See issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information.
|
||||
--> $DIR/stability-attribute-trait-impl.rs:24:1
|
||||
|
|
||||
LL | #[unstable(feature = "x", issue = "none")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `#[deny(rustc::ineffective_unstable_trait_impl)]` on by default
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in a new issue