Skip to content

Option< <'a>||> inconsistenly requires <> and the space #11209

Closed
@huonw

Description

@huonw
fn foo<'a>() {
    let _: 'a ||; // for comparison
    let _: <'a> ||;

    // let _: Option<'a ||>;
    // let _: Option<<'a>||>;
    let _: Option< <'a>||>;
}

fn main() {foo()}

Uncommenting the first and second commented lines gives, respectively:

option-closure.rs:5:21: 5:23 error: expected `,` or `>` after lifetime name, got: OROR
option-closure.rs:5     let _: Option<'a ||>;
                                         ^~
option-closure.rs:6:17: 6:19 error: expected `;` but found `<<`
option-closure.rs:6     let _: Option<<'a>||>;
                                     ^~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions