Skip to content

Trailing + in bounds are allowed #41158

Closed
@qnighy

Description

@qnighy

Current parser allows ty/lt bounds have extra +. However, the comments on the parser suggest they shouldn't be allowed. grammar.md also suggests they shouldn't.

Expected behavior

Both the first and second lines should lead to parse error.

fn f<'a>() where 'a: 'a + {}
fn g<'a, X>() where X: 'a + {}
fn main() {
}

Current behavior

The current stable and nightly compilers allow the above code.

Meta

Tested on Rust Playground.

stable

rustc 1.16.0 (30cf806ef 2017-03-10)

nightly

rustc 1.18.0-nightly (50c186419 2017-04-06)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions