-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Self alias as struct constructor #1588
Labels
T-lang
Relevant to the language team, which will review and decide on the RFC.
Comments
Yes. I'd like to do it too. |
An alternative that I've been thinking of is allowing |
That's something I intended to implement. |
@arielb1 do you mean you don't think this requires an RFC? |
Implemented at rust-lang/rust#37035, thanks @petrochenkov! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider the following code
We can't replace the last use of
Foo
in the impl withSelf
(you get E0071). ButSelf
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 ofSelf
like this.brought up here cc @huonw
The text was updated successfully, but these errors were encountered: