Conversation
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in compiler/rustc_passes/src/check_attr.rs This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a HIR ty lowering was modified cc @fmease Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes occurred in compiler/rustc_sanitizers cc @rcvalle |
|
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
644d1ce to
fac5797
Compare
|
I think the priority here is to first get parser code proof-read. |
src/tools/clippy/clippy_lints/src/arbitrary_source_item_ordering.rs
Outdated
Show resolved
Hide resolved
|
It's probably more a language-related comment, than compiler-related, but the placement of auto impls doesn't seem right. Auto impls are not associated items, they could very well live as free items, and placed into the traits just for the proximity. Even from the compiler point of view in HIR and below we'd now need to separate real associated items from the things that just live there in source code, and may break some other assumptions across the compiler about only one level of associated item nesting existing, making building the prototype harder. |
|
The semicolon in |
|
Could you add some tests executing all the supported syntax, including |
|
(I'll continue the review tomorrow.) |
|
After reading the PR I'd again suggest to implement these impls as free items first, because you'll have a whole host of issues just from trying to move them from free to associated items. |
|
Reminder, once the PR becomes ready for a review, use |
This comment was marked as resolved.
This comment was marked as resolved.
fac5797 to
99e955f
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
99e955f to
469a4cc
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
469a4cc to
c19307a
Compare
This comment has been minimized.
This comment has been minimized.
adfc499 to
ed73c51
Compare
This comment has been minimized.
This comment has been minimized.
ed73c51 to
05561eb
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
05561eb to
9e5b35b
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This patch introduce AST elements for `auto impl` inside the `trait` and `impl` block. This patch does not handle the name resolution, yet. It will be handled in the next patch series. Signed-off-by: Xiangfei Ding <dingxiangfei2009@protonmail.ch>
9e5b35b to
79a479e
Compare
|
@rustbot ready
|
|
☔ The latest upstream changes (presumably #153344) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Again, my suggestion was to turn trait BigTrait: Supertrait {
auto impl Supertrait;
fn foo(..);
}into something like trait BigTrait: Supertrait {
fn foo(..);
}
auto impl Supertrait for BigTrait {} // or similarso auto impls are never associated items at any IR level. After the feature semantics are fully implemented in this and following PRs, we can consider moving them to associated items at some level, but that would be a separate work. |
|
Thank you so much for reviewing @petrochenkov
cc @cramertj @tmandry @Darksonn Okay I can do that. If we go down this route, I would further propose adding a keyword auto impl $Supertrait for trait $Subtrait { .. }How does it sound? |
It makes sense to be syntactically explicit in some way here since one would otherwise expect that to be a type context. The other keyword that comes to mind as plausible would be |
View all comments
Tracking:
auto impl#149556This patch introduce AST elements for
auto implinside thetraitandimplblock.This patch does not handle the name resolution, yet. It will be handled in the next patch series.
RFC: rust-lang/rfcs#3851
cc
As a tracking issue is pending, I will link rust-lang/rust-project-goals#393 for more context.