Skip to content

Self overlapping error message ("unexpected tokenxpected") #41155

Closed
@est31

Description

@est31

This (invalid) code:

impl S {
	pub
}

Produces the following, okay error message on beta:

rustc 1.17.0-beta.3 (ca3d11832 2017-04-05)
error: expected one of `(`, `const`, `default`, `extern`, `fn`, `type`, or `unsafe`, found `}`
 --> <anon>:3:1
  |
3 | }
  | ^

error: aborting due to previous error

But on nightly, you get a bad, self overriding one:

rustc 1.18.0-nightly (50c186419 2017-04-06)
error: expected one of `(`, `const`, `default`, `extern`, `fn`, `type`, or `unsafe`, found `}`
 --> <anon>:3:1
  |
2 |   	pub
  |  _____- starting here...
3 | | }
  | | ^.unexpected tokenxpected one of 7 possible tokens here

error: aborting due to previous error

Note the "unexpected tokenxpected one of 7 possible tokens here". Possibly the "starting here" is not required either.

cc @estebank

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions