Skip to content

Commit

Permalink
use fileline_ and not full span_ for the followon messages
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Jan 13, 2016
1 parent f9b5463 commit 0254f69
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc/lint/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@ pub fn raw_struct_lint<'a>(sess: &'a Session,
let citation = format!("for more information, see {}",
future_incompatible.reference);
if let Some(sp) = span {
err.span_warn(sp, &explanation);
err.span_note(sp, &citation);
err.fileline_warn(sp, &explanation);
err.fileline_note(sp, &citation);
} else {
err.warn(&explanation);
err.note(&citation);
Expand Down
7 changes: 7 additions & 0 deletions src/libsyntax/errors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ impl<'a> DiagnosticBuilder<'a> {
self.sub(Level::Note, msg, Some(sp), Some(EndSpan(sp)));
self
}
pub fn fileline_warn(&mut self ,
sp: Span,
msg: &str)
-> &mut DiagnosticBuilder<'a> {
self.sub(Level::Warning, msg, Some(sp), Some(FileLine(sp)));
self
}
pub fn fileline_note(&mut self ,
sp: Span,
msg: &str)
Expand Down

0 comments on commit 0254f69

Please sign in to comment.