diff options
| author | bors <bors@rust-lang.org> | 2017-04-12 13:22:16 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-04-12 13:22:16 +0000 |
| commit | 910c4816fdee01a1299d11a5e85ebb4aceee6d1a (patch) | |
| tree | 5413288c2a03b64c62c03782b194d28e2de37739 /src/libsyntax/parse | |
| parent | 1dca19ae3fd195fa517e326a39bfee729da7cadb (diff) | |
| parent | d4d35cfecc7df36d62a0e6dbc66106657667c92e (diff) | |
| download | rust-910c4816fdee01a1299d11a5e85ebb4aceee6d1a.tar.gz rust-910c4816fdee01a1299d11a5e85ebb4aceee6d1a.zip | |
Auto merge of #41246 - TimNN:rollup, r=TimNN
Rollup of 9 pull requests - Successful merges: #41063, #41087, #41141, #41166, #41183, #41205, #41206, #41232, #41243 - Failed merges:
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 58be43526fd..3b928ea93c7 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2552,10 +2552,10 @@ impl<'a> Parser<'a> { } token::Literal(token::Float(n), _suf) => { self.bump(); - let prev_span = self.prev_span; let fstr = n.as_str(); - let mut err = self.diagnostic().struct_span_err(prev_span, + let mut err = self.diagnostic().struct_span_err(self.prev_span, &format!("unexpected token: `{}`", n)); + err.span_label(self.prev_span, &"unexpected token"); if fstr.chars().all(|x| "0123456789.".contains(x)) { let float = match fstr.parse::<f64>().ok() { Some(f) => f, @@ -2573,7 +2573,7 @@ impl<'a> Parser<'a> { word(&mut s.s, fstr.splitn(2, ".").last().unwrap()) }); err.span_suggestion( - prev_span, + lo.to(self.prev_span), "try parenthesizing the first index", sugg); } |
