Skip to content

Point at only one char on Span::next_point #41174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2017
Merged

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Apr 9, 2017

Avoid pointing at two chars so the diagnostic output doesn't display a
multiline span when starting beyond a line end.

Fix #41155.

Instead of

error: expected one of `(`, `const`, `default`, `extern`, `fn`, `type`, or `unsafe`, found `}`
 --> <anon>:3:1
  |
1 |   impl S {	pub
  |  _____________- starting here...
2 | |     
  | |  ...ending here: expected one of 7 possible tokens here
3 |   }
  |   ^ unexpected token

show

error: expected one of `(`, `const`, `default`, `extern`, `fn`, `type`, or `unsafe`, found `}`
  --> <anon>:13:1
   |
12 |     pub
   |        - expected one of 7 possible tokens here
13 | }
   | ^ unexpected token

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@frewsxcv
Copy link
Member

Travis found some issues by the way.

@estebank estebank force-pushed the issue-41155 branch 2 times, most recently from 6ed911b to db2f509 Compare April 10, 2017 10:12
@nikomatsakis
Copy link
Contributor

@estebank r=me once the errors are fixed

Avoid pointing at two chars so the diagnostic output doesn't display a
multiline span when starting beyond a line end.
@estebank
Copy link
Contributor Author

@nikomatsakis fixed. Waiting on travis to confirm that I didn't introduce a different error.

@estebank
Copy link
Contributor Author

@bors r=nikomatsakis

@bors
Copy link
Collaborator

bors commented Apr 10, 2017

📌 Commit 4c80170 has been approved by nikomatsakis

@bors
Copy link
Collaborator

bors commented Apr 11, 2017

⌛ Testing commit 4c80170 with merge bec5394...

@bors
Copy link
Collaborator

bors commented Apr 11, 2017

💔 Test failed - status-appveyor

@estebank
Copy link
Contributor Author

@bors retry

@bors
Copy link
Collaborator

bors commented Apr 11, 2017

⌛ Testing commit 4c80170 with merge 8d85504...

bors added a commit that referenced this pull request Apr 11, 2017
Point at only one char on `Span::next_point`

Avoid pointing at two chars so the diagnostic output doesn't display a
multiline span when starting beyond a line end.

Fix #41155.

Instead of

```rust
error: expected one of `(`, `const`, `default`, `extern`, `fn`, `type`, or `unsafe`, found `}`
 --> <anon>:3:1
  |
1 |   impl S {	pub
  |  _____________- starting here...
2 | |
  | |  ...ending here: expected one of 7 possible tokens here
3 |   }
  |   ^ unexpected token
```

show

```rust
error: expected one of `(`, `const`, `default`, `extern`, `fn`, `type`, or `unsafe`, found `}`
  --> <anon>:13:1
   |
12 |     pub
   |        - expected one of 7 possible tokens here
13 | }
   | ^ unexpected token
```
@bors
Copy link
Collaborator

bors commented Apr 11, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 8d85504 to master...

@bors bors merged commit 4c80170 into rust-lang:master Apr 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants