From 85fb054fefd1787260c72ee281ed7d436bc524f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Mon, 25 Nov 2019 12:36:26 -0800 Subject: [PATCH] Tweak removed feature error --- src/libsyntax/feature_gate/check.rs | 5 ++--- src/test/ui/macros/macro-reexport-removed.stderr | 8 ++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/libsyntax/feature_gate/check.rs b/src/libsyntax/feature_gate/check.rs index f966850254f..d37f48f9a4f 100644 --- a/src/libsyntax/feature_gate/check.rs +++ b/src/libsyntax/feature_gate/check.rs @@ -688,10 +688,9 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute], crate_edition: Edition, allow_features: &Option>) -> Features { fn feature_removed(span_handler: &Handler, span: Span, reason: Option<&str>) { let mut err = struct_span_err!(span_handler, span, E0557, "feature has been removed"); + err.span_label(span, "feature has been removed"); if let Some(reason) = reason { - err.span_note(span, reason); - } else { - err.span_label(span, "feature has been removed"); + err.note(reason); } err.emit(); } diff --git a/src/test/ui/macros/macro-reexport-removed.stderr b/src/test/ui/macros/macro-reexport-removed.stderr index 4bec70850af..475a586ddc0 100644 --- a/src/test/ui/macros/macro-reexport-removed.stderr +++ b/src/test/ui/macros/macro-reexport-removed.stderr @@ -2,13 +2,9 @@ error[E0557]: feature has been removed --> $DIR/macro-reexport-removed.rs:3:12 | LL | #![feature(macro_reexport)] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ feature has been removed | -note: subsumed by `pub use` - --> $DIR/macro-reexport-removed.rs:3:12 - | -LL | #![feature(macro_reexport)] - | ^^^^^^^^^^^^^^ + = note: subsumed by `pub use` error: cannot find attribute `macro_reexport` in this scope --> $DIR/macro-reexport-removed.rs:5:3