Use proper span for tuple index parsed as float

Fix diagnostic suggestion from:

```rust
help: try parenthesizing the first index
  |     (1, (2, 3)).((1, (2, 3)).1).1;
```

to the correct:

```rust
help: try parenthesizing the first index
  |     ((1, (2, 3)).1).1;
```
This commit is contained in:
Esteban Küber 2017-04-05 09:50:04 -07:00
parent 5309a3e31d
commit 44e414c477
3 changed files with 15 additions and 6 deletions

View file

@ -11,7 +11,5 @@
// compile-flags: -Z parse-only
fn main () {
(1, (2, 3)).1.1; //~ ERROR unexpected token
//~^ HELP try parenthesizing the first index
//~| SUGGESTION ((1, (2, 3)).1).1
(1, (2, 3)).1.1;
}

View file

@ -0,0 +1,11 @@
error: unexpected token: `1.1`
--> $DIR/tuple-float-index.rs:14:17
|
14 | (1, (2, 3)).1.1;
| ^^^ unexpected token
|
help: try parenthesizing the first index
| ((1, (2, 3)).1).1;
error: aborting due to previous error