about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-03-04 17:49:26 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-03-05 12:38:32 +0530
commitc8c4d85b5014a947f57acd9a1e14b7864689f73d (patch)
tree0050171f1130396271d588b6a44f90f6f712245e /src/libsyntax/ext
parent4de4234795b9fabe14482f817ab2936a6439b7dd (diff)
parent7496539a00b36d86620699576bc7c82ce03dca7e (diff)
downloadrust-c8c4d85b5014a947f57acd9a1e14b7864689f73d.tar.gz
rust-c8c4d85b5014a947f57acd9a1e14b7864689f73d.zip
Rollup merge of #22764 - ivanradanov:fileline_help, r=huonw
 When warnings and errors occur, the associated help message should not print the same code snippet.
https://github.com/rust-lang/rust/issues/21938
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/base.rs4
-rw-r--r--src/libsyntax/ext/expand.rs2
2 files changed, 5 insertions, 1 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index f6bdd693cfa..a8c35c1fdb1 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -753,6 +753,10 @@ impl<'a> ExtCtxt<'a> {
         self.print_backtrace();
         self.parse_sess.span_diagnostic.span_help(sp, msg);
     }
+    pub fn fileline_help(&self, sp: Span, msg: &str) {
+        self.print_backtrace();
+        self.parse_sess.span_diagnostic.fileline_help(sp, msg);
+    }
     pub fn bug(&self, msg: &str) -> ! {
         self.print_backtrace();
         self.parse_sess.span_diagnostic.handler().bug(msg);
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index bea57ae14e4..8896a8e0c4f 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -571,7 +571,7 @@ fn contains_macro_use(fld: &mut MacroExpander, attrs: &[ast::Attribute]) -> bool
             fld.cx.span_warn(attr.span, "macro_escape is a deprecated synonym for macro_use");
             is_use = true;
             if let ast::AttrInner = attr.node.style {
-                fld.cx.span_help(attr.span, "consider an outer attribute, \
+                fld.cx.fileline_help(attr.span, "consider an outer attribute, \
                                              #[macro_use] mod ...");
             }
         };