Skip to content

Handle missing closing brackets in turbofish #57819

Description

@estebank

Like #57817 handles too many closing brackets in type arguments when using turbofish, we should also handle too few closing brackets correctly with an appropriate suggestion (and proper item generation):

fn main() {
    println!("{:?}", vec![1, 2, 3].into_iter().collect::<Vec<usize>());
}

Activity

  1. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    A-parserArea: The lexing & parsing of Rust source code to an AST
    A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`
    on Jan 21, 2019
  2. abonander commented on Jan 21, 2019

    @abonander
    Contributor

    @estebank looks like you got your link syntax turned around

  3. self-assigned this
    on Jan 23, 2019
  4. davidtwco commented on Jan 23, 2019

    @davidtwco
    Member

    I've submitted #57852 for this. It takes the opposite approach to that suggested here, instead of suggesting that extra > characters are added at the end (and making redundant pairs of angle brackets legal), it suggests that unmatched leading < characters are removed.

    I think if suggestions are applied with this approach that it ends up with a cleaner result (at the expense of implementation complexity). Happy to scrap that and take the approach suggested here instead if preferred.

  5. added 2 commits that reference this issue on Jan 26, 2019
    89f0a22
    e77959e
  6. added a commit that references this issue on Jan 26, 2019
    46a43dc
  7. added a commit that references this issue on Feb 1, 2021
  8. added a commit that references this issue on Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions