Skip to content

The <T as U> syntax generates parsing errors #19066

@tomaka

Description

@tomaka

Example: (http://is.gd/zRXt7J)

trait Foo {
    type T;
    fn test(&self) -> Vec<<Self as Foo>::T>;
}

Generates:

<anon>:5:26: 5:28 error: expected `;` or `{`, found `<<`
<anon>:5     fn test(&self) -> Vec<<Self as Foo>::T>;

Adding a space between Vec< and <Self as Foo> fixes the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions