about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorcsmoe <35686186+csmoe@users.noreply.github.com>2018-07-04 11:48:56 +0800
committercsmoe <35686186+csmoe@users.noreply.github.com>2018-07-06 22:31:55 +0800
commit88f475c8083f668218f93afa88eab4410769cdcd (patch)
treef4a82b0f30d6ad45c980f2357d420e33b95b294d /src/libsyntax_ext
parentc999b253b7587cd647b06582f10d55cbaf65e635 (diff)
downloadrust-88f475c8083f668218f93afa88eab4410769cdcd.tar.gz
rust-88f475c8083f668218f93afa88eab4410769cdcd.zip
suggests with whole macro call
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/concat.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/libsyntax_ext/concat.rs b/src/libsyntax_ext/concat.rs
index 1f79c1db995..2325bcbd657 100644
--- a/src/libsyntax_ext/concat.rs
+++ b/src/libsyntax_ext/concat.rs
@@ -14,7 +14,6 @@ use syntax::ext::build::AstBuilder;
 use syntax::symbol::Symbol;
 use syntax_pos;
 use syntax::tokenstream;
-use syntax::print::pprust;
 
 use std::string::String;
 
@@ -55,15 +54,7 @@ pub fn expand_syntax_ext(cx: &mut base::ExtCtxt,
             }
             _ => {
                 let mut err = cx.struct_span_err(e.span, "expected a literal");
-                let msg = cx.codemap().span_to_snippet(e.span).unwrap_or_else(
-                    |_| pprust::expr_to_string(&e)
-                );
-                err.span_suggestion(
-                    e.span,
-                    "consider changing this to",
-                    format!("\"{{}}\", {}", msg)
-                );
-                err.span_note(
+                err.span_help(
                     e.span,
                     "you might be missing a string literal to format with",
                 );