Skip to content
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

Should not claim to expect > for "error: expected one of ..., >, ... or an operator, found >" #24780

Closed
cjsut opened this issue Apr 24, 2015 · 3 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@cjsut
Copy link
Contributor

cjsut commented Apr 24, 2015

Test-case playpen.

This currently happens for both beta and nightly.

@tbelaire
Copy link
Contributor

Just inlining the example and error:

fn foo() -> Vec<usize>> {
    //                ^
    // error: expected one of `(`, `+`, `::`, `<`, `>`, `where`, or `{`, found `>`
    Vec::new()
}

@sfackler sfackler added the A-diagnostics Area: Messages for errors, warnings, and lints label Apr 25, 2015
bors added a commit that referenced this issue Feb 10, 2016
Previously when breaking tokens into smaller pieces, the replace_token
function have been used. It replaced current token and updated span
information, but it did not clear the list of expected tokens, neither
did it update remaining info about last token. This could lead to
incorrect error message, like one described in the issue #24780:

    expected one of ... `>` ...  found `>`
@bltavares
Copy link
Contributor

This issue has been resolved after #31455 got merged.

rustc 1.8.0-nightly (3f4227af1 2016-02-10)

The error now is the following:

tmp/24780.rs:1:23: 1:24 error: expected one of `!`, `::`, `where`, or `{`, found `>`
tmp/24780.rs:1 fn foo() -> Vec<usize>> {
                                     ^
error: aborting due to previous error

@alexcrichton
Copy link
Member

Thanks @bltavares!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

5 participants