]> git.lizzy.rs Git - rust.git/commitdiff
use fileline_ and not full span_ for the followon messages
authorNiko Matsakis <niko@alum.mit.edu>
Wed, 13 Jan 2016 00:38:12 +0000 (19:38 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 13 Jan 2016 00:38:12 +0000 (19:38 -0500)
src/librustc/lint/context.rs
src/libsyntax/errors/mod.rs

index dca83dadec14be83ce12f97c7a52fd9a86fe05bd..2fc2448dd0c145089379c0efa3d737c922dd4856 100644 (file)
@@ -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);
index 16e5f06c07c9e8168dd3a3274ed3c34af45cf727..05398d10a94a270acfd9b0eb0bff46cb14aa29f5 100644 (file)
@@ -200,6 +200,13 @@ pub fn span_end_note(&mut self ,
         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)