-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Self
in type definitions (self_in_typedefs)
#53324
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
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Err, is tidy broken here? That line definitely isn't longer than 100 chars. |
@alexreg: I'm not sure about the 100 character message, but there's an issue with the diagnostic length:
|
@varkor Yeah, I noticed that after I posted the above, but thanks! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@Centril Turns out having this feature for |
@alexreg leave it out ;) |
All should be in order now! Ready for a review, @eddyb. |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
src/doc/unstable-book/src/language-features/self-in-typedefs.md
Outdated
Show resolved
Hide resolved
@@ -2968,7 +2990,12 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> { | |||
if is_self_type(path, ns) { | |||
__diagnostic_used!(E0411); | |||
err.code(DiagnosticId::Error("E0411".into())); | |||
err.span_label(span, "`Self` is only available in traits and impls"); | |||
let available_in = if this.session.features_untracked().self_in_typedefs { | |||
"impls, traits, and type definitions" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order here changed, is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is. I had accidentally deleted it before and rewritten it the wrong way round, which broke some UI tests. :-P So this fixes it.
Currently type definitions include `struct`, `enum`, `union`, `existential type`.
@bors r+ |
📌 Commit 4e7d3f5 has been approved by |
`Self` in type definitions (self_in_typedefs) This implements the [`self_in_typedefs` feature](https://github.com/rust-lang/rfcs/blob/master/text/2300-self-in-typedefs.md) ([tracking issue 49303](#49303)). r? @eddyb CC @Centril
☀️ Test successful - status-appveyor, status-travis |
This implements the
self_in_typedefs
feature (tracking issue 49303).r? @eddyb
CC @Centril