Skip to content

Invalid error: unmatched angle bracket #78565

Closed
@glandium

Description

@glandium

The following code, reduced from glean-core 31.4.0, fails to compile on current master:

pub struct DebugOption<T, F = fn(T) -> Option<T>> {
  t: T,
  f: F,
}

The error is:

error: unmatched angle bracket
 --> src/lib.rs:1:49
  |
1 | pub struct DebugOption<T, F = fn(T) -> Option<T>> {
  |                                                 ^^ help: remove extra angle bracket

The last nightly that rustup allows me to install (rustc 1.49.0-nightly (ffa2e7a 2020-10-24)) compiles it fine.

Interestingly, this doesn't happen with:

pub struct DebugOption<T, F = fn(T) -> Option<T>>(T, F);

git bisect points to ff61949 (#78379)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions