-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.
Description
Consider the following code
struct Foo { a: i32 }
impl Default for Foo {
fn default() -> Self {
Foo { a: 42 }
}
}
We can't replace the last use of Foo
in the impl with Self
(you get E0071). But Self
is a kind of type alias, or it acts like one anyway, and normally you can construct a struct through a type alias. So we should allow usage of Self
like this.
MoSal, bungcip, oli-obk, bluss, Stebalien and 18 moreticki
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.