Skip to content

Commit 5420fa3

Browse files
committed
Add test for #[unstable] impl for fn() -> !.
1 parent a44a22d commit 5420fa3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/test/ui/stability-attribute/stability-attribute-trait-impl.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,8 @@ impl StableTrait for extern "C-unwind" fn() {}
3333
//~^ ERROR an `#[unstable]` annotation here has no effect [ineffective_unstable_trait_impl]
3434
impl StableTrait for StableType {}
3535

36+
#[unstable(feature = "k", issue = "none")]
37+
//~^ ERROR an `#[unstable]` annotation here has no effect [ineffective_unstable_trait_impl]
38+
impl StableTrait for fn() -> ! {}
39+
3640
fn main() {}

src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ LL | #[unstable(feature = "j", issue = "none")]
77
= note: see issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information
88
= note: `#[deny(ineffective_unstable_trait_impl)]` on by default
99

10+
error: an `#[unstable]` annotation here has no effect
11+
--> $DIR/stability-attribute-trait-impl.rs:36:1
12+
|
13+
LL | #[unstable(feature = "k", issue = "none")]
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15+
|
16+
= note: see issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information
17+
1018
error: module has missing stability attribute
1119
--> $DIR/stability-attribute-trait-impl.rs:1:1
1220
|
@@ -19,5 +27,5 @@ LL | |
1927
LL | | fn main() {}
2028
| |____________^
2129

22-
error: aborting due to 2 previous errors
30+
error: aborting due to 3 previous errors
2331

0 commit comments

Comments
 (0)