Skip to content

Commit 0254f69

Browse files
committed
use fileline_ and not full span_ for the followon messages
1 parent f9b5463 commit 0254f69

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/librustc/lint/context.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,8 @@ pub fn raw_struct_lint<'a>(sess: &'a Session,
451451
let citation = format!("for more information, see {}",
452452
future_incompatible.reference);
453453
if let Some(sp) = span {
454-
err.span_warn(sp, &explanation);
455-
err.span_note(sp, &citation);
454+
err.fileline_warn(sp, &explanation);
455+
err.fileline_note(sp, &citation);
456456
} else {
457457
err.warn(&explanation);
458458
err.note(&citation);

src/libsyntax/errors/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,13 @@ impl<'a> DiagnosticBuilder<'a> {
200200
self.sub(Level::Note, msg, Some(sp), Some(EndSpan(sp)));
201201
self
202202
}
203+
pub fn fileline_warn(&mut self ,
204+
sp: Span,
205+
msg: &str)
206+
-> &mut DiagnosticBuilder<'a> {
207+
self.sub(Level::Warning, msg, Some(sp), Some(FileLine(sp)));
208+
self
209+
}
203210
pub fn fileline_note(&mut self ,
204211
sp: Span,
205212
msg: &str)

0 commit comments

Comments
 (0)