-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fully-Explicit Syntax #1
Comments
I will continue to prefer using a regular type alias with regular |
One thing that should also be resolved as a part of this is figuring out which type and lifetime parameters are in scope for a type-aliased trait Foo<'a> {
type Bar;
fn foo() -> Self::Bar;
}
impl<'a> Foo<'a> for i32 {
type Bar = impl Debug;
fn foo() -> Self::Bar {
42
}
} In this example, I'd presume that |
@cramertj I think the latest RFC wants |
@eddyb Ah, so, amended example: trait Foo<T> {
type Bar;
fn foo() -> Self::Bar;
}
impl<T> Foo<T> for i32 {
type Bar = impl Debug;
fn foo() -> Self::Bar {
42
}
} In this case, trait Foo<T> {
type Bar;
fn foo() -> Self::Bar;
}
type MyBar = impl Debug;
impl<T> Foo<T> for i32 {
type Bar = MyBar;
fn foo() -> MyBar {
42
}
} |
The general goal of this issue is to be able to name an
impl Trait
type.@aturon sketched out a strawman for this in their expanded
impl Trait
RFC. The proposed syntax wasabstype Foo: SomeTrait
.@eddyb explained their preference for the
type Foo = impl Trait
syntax here.The text was updated successfully, but these errors were encountered: