diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-09-11 21:42:28 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2020-09-11 21:42:28 +0200 |
| commit | 14cc17759de0863e85eea46c0f5bfcc362d1bfe8 (patch) | |
| tree | 3a523eadb17affec211037acc02d478f5142ab8b | |
| parent | 1c1bfba84a92e0fe8bf1eb85e8c3e3d10caf07cb (diff) | |
| download | rust-14cc17759de0863e85eea46c0f5bfcc362d1bfe8.tar.gz rust-14cc17759de0863e85eea46c0f5bfcc362d1bfe8.zip | |
Improve `ineffective_unstable_trait_impl` error message.
3 files changed, 7 insertions, 6 deletions
diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index 4eb983365ff..4ca52f405fb 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -561,10 +561,10 @@ impl Visitor<'tcx> for Checker<'tcx> { INEFFECTIVE_UNSTABLE_TRAIT_IMPL, item.hir_id, span, - |lint| lint.build( - "An `#[unstable]` annotation here has no effect. \ - See issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information.", - ).emit() + |lint| lint + .build("an `#[unstable]` annotation here has no effect") + .note("see issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information") + .emit() ); } } diff --git a/src/test/ui/stability-attribute/stability-attribute-trait-impl.rs b/src/test/ui/stability-attribute/stability-attribute-trait-impl.rs index 9be772a7be3..cc57071b87c 100644 --- a/src/test/ui/stability-attribute/stability-attribute-trait-impl.rs +++ b/src/test/ui/stability-attribute/stability-attribute-trait-impl.rs @@ -22,7 +22,7 @@ impl StableTrait for UnstableType {} impl UnstableTrait for StableType {} #[unstable(feature = "x", issue = "none")] -//~^ ERROR An `#[unstable]` annotation here has no effect. +//~^ ERROR an `#[unstable]` annotation here has no effect [rustc::ineffective_unstable_trait_impl] impl StableTrait for StableType {} fn main() {} diff --git a/src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr b/src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr index 808636238fc..1915d03fb0a 100644 --- a/src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr +++ b/src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr @@ -1,10 +1,11 @@ -error: An `#[unstable]` annotation here has no effect. See issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information. +error: an `#[unstable]` annotation here has no effect --> $DIR/stability-attribute-trait-impl.rs:24:1 | LL | #[unstable(feature = "x", issue = "none")] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[deny(rustc::ineffective_unstable_trait_impl)]` on by default + = note: see issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information error: aborting due to previous error |
