diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2016-04-20 14:49:16 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2016-05-02 11:49:23 -0400 |
| commit | 489a6c95bf747059b28472efc17d39795c6adcad (patch) | |
| tree | 8291d94bde59caa3b22d2ab3366af46dc5519751 /src/libsyntax/parse/parser.rs | |
| parent | 1ff1887cc9537cf45c2bc405ce0b026ef9a2246a (diff) | |
| download | rust-489a6c95bf747059b28472efc17d39795c6adcad.tar.gz rust-489a6c95bf747059b28472efc17d39795c6adcad.zip | |
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.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 671a11b57de..b9188f5101d 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -583,7 +583,7 @@ impl<'a> Parser<'a> { let mut err = self.fatal(&format!("expected identifier, found `{}`", self.this_token_to_string())); if self.token == token::Underscore { - err.fileline_note(self.span, "`_` is a wildcard pattern, not an identifier"); + err.note("`_` is a wildcard pattern, not an identifier"); } Err(err) } @@ -1082,7 +1082,7 @@ impl<'a> Parser<'a> { } pub fn span_fatal_help(&self, sp: Span, m: &str, help: &str) -> DiagnosticBuilder<'a> { let mut err = self.sess.span_diagnostic.struct_span_fatal(sp, m); - err.fileline_help(sp, help); + err.help(help); err } pub fn bug(&self, m: &str) -> ! { @@ -2622,10 +2622,9 @@ impl<'a> Parser<'a> { Some(f) => f, None => continue, }; - err.fileline_help(last_span, - &format!("try parenthesizing the first index; e.g., `(foo.{}){}`", - float.trunc() as usize, - format!(".{}", fstr.splitn(2, ".").last().unwrap()))); + err.help(&format!("try parenthesizing the first index; e.g., `(foo.{}){}`", + float.trunc() as usize, + format!(".{}", fstr.splitn(2, ".").last().unwrap()))); } return Err(err); @@ -3134,7 +3133,7 @@ impl<'a> Parser<'a> { let mut err = self.diagnostic().struct_span_err(op_span, "chained comparison operators require parentheses"); if op.node == BinOpKind::Lt && *outer_op == AssocOp::Greater { - err.fileline_help(op_span, + err.help( "use `::<...>` instead of `<...>` if you meant to specify type arguments"); } err.emit(); @@ -4951,13 +4950,13 @@ impl<'a> Parser<'a> { if is_macro_rules { self.diagnostic().struct_span_err(span, "can't qualify macro_rules \ invocation with `pub`") - .fileline_help(span, "did you mean #[macro_export]?") + .help("did you mean #[macro_export]?") .emit(); } else { self.diagnostic().struct_span_err(span, "can't qualify macro \ invocation with `pub`") - .fileline_help(span, "try adjusting the macro to put `pub` \ - inside the invocation") + .help("try adjusting the macro to put `pub` \ + inside the invocation") .emit(); } } @@ -5857,7 +5856,7 @@ impl<'a> Parser<'a> { if self.eat_keyword(keywords::Mut) { let last_span = self.last_span; self.diagnostic().struct_span_err(last_span, "const globals cannot be mutable") - .fileline_help(last_span, "did you mean to declare a static?") + .help("did you mean to declare a static?") .emit(); } let (ident, item_, extra_attrs) = self.parse_item_const(None)?; |
