Skip to content

Commit 14cc177

Browse files
committed
Improve ineffective_unstable_trait_impl error message.
1 parent 1c1bfba commit 14cc177

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

compiler/rustc_passes/src/stability.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,10 @@ impl Visitor<'tcx> for Checker<'tcx> {
561561
INEFFECTIVE_UNSTABLE_TRAIT_IMPL,
562562
item.hir_id,
563563
span,
564-
|lint| lint.build(
565-
"An `#[unstable]` annotation here has no effect. \
566-
See issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information.",
567-
).emit()
564+
|lint| lint
565+
.build("an `#[unstable]` annotation here has no effect")
566+
.note("see issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information")
567+
.emit()
568568
);
569569
}
570570
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl StableTrait for UnstableType {}
2222
impl UnstableTrait for StableType {}
2323

2424
#[unstable(feature = "x", issue = "none")]
25-
//~^ ERROR An `#[unstable]` annotation here has no effect.
25+
//~^ ERROR an `#[unstable]` annotation here has no effect [rustc::ineffective_unstable_trait_impl]
2626
impl StableTrait for StableType {}
2727

2828
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
error: An `#[unstable]` annotation here has no effect. See issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information.
1+
error: an `#[unstable]` annotation here has no effect
22
--> $DIR/stability-attribute-trait-impl.rs:24:1
33
|
44
LL | #[unstable(feature = "x", issue = "none")]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `#[deny(rustc::ineffective_unstable_trait_impl)]` on by default
8+
= note: see issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information
89

910
error: aborting due to previous error
1011

0 commit comments

Comments
 (0)