From 14cc17759de0863e85eea46c0f5bfcc362d1bfe8 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Fri, 11 Sep 2020 21:42:28 +0200 Subject: [PATCH] Improve `ineffective_unstable_trait_impl` error message. --- compiler/rustc_passes/src/stability.rs | 8 ++++---- .../stability-attribute/stability-attribute-trait-impl.rs | 2 +- .../stability-attribute-trait-impl.stderr | 3 ++- 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 @@ fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) { INEFFECTIVE_UNSTABLE_TRAIT_IMPL, item.hir_id, span, - |lint| lint.build( - "An `#[unstable]` annotation here has no effect. \ - See issue #55436 for more information.", - ).emit() + |lint| lint + .build("an `#[unstable]` annotation here has no effect") + .note("see issue #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 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 for more information error: aborting due to previous error