Skip to content

Commit 85fb054

Browse files
committed
Tweak removed feature error
1 parent 5ef4716 commit 85fb054

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/libsyntax/feature_gate/check.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -688,10 +688,9 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute],
688688
crate_edition: Edition, allow_features: &Option<Vec<String>>) -> Features {
689689
fn feature_removed(span_handler: &Handler, span: Span, reason: Option<&str>) {
690690
let mut err = struct_span_err!(span_handler, span, E0557, "feature has been removed");
691+
err.span_label(span, "feature has been removed");
691692
if let Some(reason) = reason {
692-
err.span_note(span, reason);
693-
} else {
694-
err.span_label(span, "feature has been removed");
693+
err.note(reason);
695694
}
696695
err.emit();
697696
}

src/test/ui/macros/macro-reexport-removed.stderr

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@ error[E0557]: feature has been removed
22
--> $DIR/macro-reexport-removed.rs:3:12
33
|
44
LL | #![feature(macro_reexport)]
5-
| ^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^ feature has been removed
66
|
7-
note: subsumed by `pub use`
8-
--> $DIR/macro-reexport-removed.rs:3:12
9-
|
10-
LL | #![feature(macro_reexport)]
11-
| ^^^^^^^^^^^^^^
7+
= note: subsumed by `pub use`
128

139
error: cannot find attribute `macro_reexport` in this scope
1410
--> $DIR/macro-reexport-removed.rs:5:3

0 commit comments

Comments
 (0)