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

::: typo in turbofish doesn't have a good error #65569

Closed
estebank opened this issue Oct 18, 2019 · 0 comments · Fixed by #66098
Closed

::: typo in turbofish doesn't have a good error #65569

estebank opened this issue Oct 18, 2019 · 0 comments · Fixed by #66098
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST D-confusing Diagnostics: Confusing error or lint that should be reworked. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@estebank
Copy link
Contributor

The following code is using a single : instead of a mod-sep :::

fn main() -> Result<(), ()> {
    vec![Ok(2)].into_iter().collect:<Result<Vec<_>,_>>()?;
    Ok(())
}

The compiler doesn't point at the problem:

error: expected `::`, found `(`
 --> src/main.rs:2:55
  |
2 |     vec![Ok(2)].into_iter().collect:<Result<Vec<_>,_>>()?;
  |                                                       ^ expected `::`

It should point at the : after collect.

@estebank estebank added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. D-confusing Diagnostics: Confusing error or lint that should be reworked. labels Oct 18, 2019
@Centril Centril added the A-parser Area: The parsing of Rust source code to an AST label Oct 19, 2019
Centril added a commit to Centril/rust that referenced this issue Nov 5, 2019
…tril

Detect `::` -> `:` typo when involving turbofish

Fix rust-lang#65569.
@bors bors closed this as completed in 409b2bf Nov 6, 2019
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 A-parser Area: The parsing of Rust source code to an AST D-confusing Diagnostics: Confusing error or lint that should be reworked. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants