Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Should generic argument order be part of the syntax? #40

Open
@ehuss

Description

@ehuss

In 1.34, via rust-lang/rust#58191, the restriction that lifetimes appear before types in generic arguments was removed from libsyntax. However, type bindings are still required to be after types and lifetimes.

Should this order constraint be part of the syntax? The current lyg grammar (and libsyntax) encodes this restriction. But after discussing this on Discord, I was wondering why relax one constraint but not the other?

Example:

fn test<W, I: Trait<Item=(), W> >() {}

See parse_generic_args which I think implies this should not be restricted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-nominated-langNominated for language team discussiongrammarIssues with the definition of the rust grammarrestrictionsIssues related to the permissiveness of the grammar

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions