-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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.
a068db3
to
f072530
Compare
This comment has been minimized.
This comment has been minimized.
f072530
to
fb02eee
Compare
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! |
6d1ff67
to
8d22725
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
923940a
to
49844be
Compare
This comment has been minimized.
This comment has been minimized.
49844be
to
8c79363
Compare
This comment has been minimized.
This comment has been minimized.
@Centril Turns out having this feature for |
@alexreg leave it out ;) |
8c79363
to
3558049
Compare
Self
in type definitions (self_in_typedefs)Self
in type definitions (self_in_typedefs)
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 |
3558049
to
a4a63d4
Compare
src/doc/unstable-book/src/language-features/self-in-typedefs.md
Outdated
Show resolved
Hide resolved
a4a63d4
to
44bf945
Compare
@@ -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`.
44bf945
to
4e7d3f5
Compare
@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