-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)
Description
With this preamble:
struct A;
struct B;
trait F<T> {}
this code does not compile:
fn f<T: F<A> + F<B>>() {}
but this does:
fn f<T>() where T : F<A> + F<B> {}
As an example of a case where this can't be worked around, consider associated types. This example does not seem to have any possible workaround:
trait G {
type X : F<A> + F<B>;
}
This attempt at a workaround causes an ICE:
trait G where Self::X : F<A> + F<B> {
type X;
}
and this example apparently isn't valid syntax:
trait G {
type X where X : F<A> + F<B>;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)
Type
Fields
Give feedbackNo fields configured for issues without a type.