replace fileline_{help,note} with {help,note}

The extra filename and line was mainly there to keep the indentation
relative to the main snippet; now that this doesn't include
filename/line-number as a prefix, it is distracted.
This commit is contained in:
Niko Matsakis
2016-04-20 14:49:16 -04:00
parent 1ff1887cc9
commit 489a6c95bf
25 changed files with 172 additions and 260 deletions

View File

@@ -764,15 +764,14 @@ impl<'a> ExtCtxt<'a> {
pub fn suggest_macro_name(&mut self,
name: &str,
span: Span,
err: &mut DiagnosticBuilder<'a>) {
let names = &self.syntax_env.names;
if let Some(suggestion) = find_best_match_for_name(names.iter(), name, None) {
if suggestion != name {
err.fileline_help(span, &format!("did you mean `{}!`?", suggestion));
err.help(&format!("did you mean `{}!`?", suggestion));
} else {
err.fileline_help(span, &format!("have you added the `#[macro_use]` on the \
module/import?"));
err.help(&format!("have you added the `#[macro_use]` on the \
module/import?"));
}
}
}