rust-lang / reference

The Rust Reference
https://doc.rust-lang.org/nightly/reference/
Apache License 2.0
1.18k stars 459 forks source link

`GenericArgsBinding` doesn't account for GATs #1380

Open lowr opened 1 year ago

lowr commented 1 year ago

Currently, GenericArgsBinding is defined as follows (link):

GenericArgsBinding :
   IDENTIFIER = Type

This definition does not account for GATs. It should include optional generic arguments after the identifier.

ehuss commented 1 year ago

Is there a stable way to actually use that?

lowr commented 1 year ago

The following code compiles on stable and Assoc<i32> = () part is an example of GenericArgsBinding with a generic argument if I'm not mistaken?

trait Trait {
    type Assoc<T>;
}

fn foo<T>(_: T)
where
    T: Trait<Assoc<i32> = ()>
{}

(playground)

ehuss commented 1 year ago

Yep, thanks!