-
Notifications
You must be signed in to change notification settings - Fork 14k
syntax: Rewrite parsing of impls #46455
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
|
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
src/libsyntax/parse/parser.rs
Outdated
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.
I didn't add new tests for all this stuff because impls for .. are going to be removed pretty soon.
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.
I think we can even do it now, if we do some more #[cfg(stage0)] stuff.
nikomatsakis
left a comment
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.
r=me with a delay-span-bug call
src/librustc_typeck/check/wfcheck.rs
Outdated
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.
aren't these just called auto trait now or something? I thought we landed some such PR.
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.
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.
delay_span_bug please
src/libsyntax/parse/parser.rs
Outdated
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.
I think we can even do it now, if we do some more #[cfg(stage0)] stuff.
|
This PR is not super urgent, I'll merge it after #46480 lands. |
|
☔ The latest upstream changes (presumably #46083) made this pull request unmergeable. Please resolve the merge conflicts. |
Properly parse impls for the never type `!` Recover from missing `for` in `impl Trait for Type` Prohibit inherent default impls and default impls of auto traits Change wording in more diagnostics to use "auto traits" Some minor code cleanups in the parser
|
@bors r=nikomatsakis |
|
📌 Commit 60c48dd has been approved by |
syntax: Rewrite parsing of impls Properly parse impls for the never type `!` Recover from missing `for` in `impl Trait for Type` Prohibit inherent default impls and default impls of auto traits (#37653 (comment), #37653 (comment)) Change wording in more diagnostics to use "auto traits" Fix some spans in diagnostics Some other minor code cleanups in the parser Disambiguate generics and qualified paths in impls (parse `impl <Type as Trait>::AssocTy { ... }`) Replace the future-compatibility hack from #38268 with actually parsing generic parameters Add a test for #46438
| This will compile: | ||
| ```ignore (ignore auto_trait future compatibility warning) |
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.
this ignore can be removed
|
☀️ Test successful - status-appveyor, status-travis |
Properly parse impls for the never type
!Recover from missing
forinimpl Trait for TypeProhibit inherent default impls and default impls of auto traits (#37653 (comment), #37653 (comment))
Change wording in more diagnostics to use "auto traits"
Fix some spans in diagnostics
Some other minor code cleanups in the parser
Disambiguate generics and qualified paths in impls (parse
impl <Type as Trait>::AssocTy { ... })Replace the future-compatibility hack from #38268 with actually parsing generic parameters
Add a test for #46438