-
Notifications
You must be signed in to change notification settings - Fork 198
Open
Labels
Description
trait Foo {
type Bar<T>;
fn foo<T>(self, value: T) -> Self::Bar<T>;
fn baz<T>(self, value: T) -> Self::Bar<T>;
}
impl Foo for i32 {
type Bar<T> = T;
fn foo<T>(self, value: T) -> Self::Bar<T> {
value
}
fn baz<T>(self, value: T) -> Self::Bar<T> {
value
}
}
fn main() {
let a = 15;
let b = a.foo::<i8>(14i8);
let c = a.baz::<u32>(32u32);
dbg!(a, b, c);
}From zulip @CohenArthur https://gcc-rust.zulipchat.com/#narrow/channel/281658-compiler-development/topic/GAT's/near/556945336
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo