-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)C-bugCategory: This is a bug.Category: This is a bug.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
I tried this code:
trait Trait {
type Gat<T>;
}
trait Subtrait: Trait<Gat<u32> = u32, Gat<u64> = u64> {}
I expected to see this happen: It compiles
Instead, this happened:
error[E0719]: the value of the associated type `Gat` in trait `Trait` is already specified
--> src/lib.rs:5:39
|
5 | trait Subtrait: Trait<Gat<u32> = u32, Gat<u64> = u64> {}
| -------------- ^^^^^^^^^^^^^^ re-bound here
| |
| `Gat` bound here first
For more information about this error, try `rustc --explain E0719`.
(Perhaps E0719 should be removed entirely, and turned into a lint?)
Meta
rustc --version
:
1.88.0
Originally reported on Internals: https://internals.rust-lang.org/t/multiple-gat-constraints-with-different-generics-on-trait-bounds/23148
@rustbot label T-types A-associated-items A-GATs
Ddystopia, JarvisCraft and js2xxx
Metadata
Metadata
Assignees
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)C-bugCategory: This is a bug.Category: This is a bug.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.