Replacing self overwriting with proper resolution#152996
Replacing self overwriting with proper resolution#152996mu001999 wants to merge 3 commits intorust-lang:mainfrom
self overwriting with proper resolution#152996Conversation
This comment has been minimized.
This comment has been minimized.
178d259 to
abd6031
Compare
This comment has been minimized.
This comment has been minimized.
abd6031 to
3102edf
Compare
This comment has been minimized.
This comment has been minimized.
3102edf to
c206a47
Compare
self appear at the end of any paths in importsself at the end of any paths in imports
This comment has been minimized.
This comment has been minimized.
c206a47 to
d7a8a0a
Compare
d7a8a0a to
d845289
Compare
This comment has been minimized.
This comment has been minimized.
d845289 to
77169f5
Compare
This comment has been minimized.
This comment has been minimized.
77169f5 to
ce8d16a
Compare
This comment has been minimized.
This comment has been minimized.
b4d62d4 to
9ac9e00
Compare
This comment has been minimized.
This comment has been minimized.
9ac9e00 to
39dc3a0
Compare
|
It looks like #146972 (comment) suggests to support trailing However, if we are doing it, then I think it's time to abandon the whole " |
Semantics of trailing But what will trailing |
0eee7bc to
bcd6516
Compare
|
@rustbot review |
This comment has been minimized.
This comment has been minimized.
|
@rustbot author |
This comment has been minimized.
This comment has been minimized.
|
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
|
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 code currently compiles in stable rust: struct Thing;
use Thing::{self as Alias};If this code will stop compiling with this PR, then this PR needs a crater run. |
|
Yes, we'll certainly run crater. |
|
Let's perhaps split this into 2 steps.
The first part may require a new deprecation lint for the |
|
@rustbot review |
|
Could you limit this PR to just the first step from #152996 (comment)? |
|
@rustbot review |
|
Thanks! |
This comment has been minimized.
This comment has been minimized.
|
Is it safe to remove the T-Clippy label? |
I think it is now :) |
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
View all comments
As a follow-up PR to #146972 (step 1), after this PR:
1. Trailing(in future)selfcan appear in paths (as the consensus in #146972 (comment))2. E0429 will be no longer emitted,(in future)use ...::self [as target];will be equivalent touse ...::{self [as target]};3. Things like
struct S {}; use S::{self as Other};will be rejectedThis PR used to add a new lint
redundant_self, which would lintuse ...::self [as target];anduse ...::{self [as target]};, and the last commit fixes all warnings emitted by this lint.But this lint and clippy lint unnecessary_self_imports have some overlap. And
use std::io::self;is not equivalent touse std::ioin fact for now, the new lint will also cause the following known issue:So I removed this lint, and I think what it does should be done by extending the clippy lint
unnecessary_self_imports.r? petrochenkov