-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Commit 8b21296
Auto merge of #117772 - surechen:for_117448, r=petrochenkov
Tracking import use types for more accurate redundant import checking
fixes #117448
By tracking import use types to check whether it is scope uses or the other situations like module-relative uses, we can do more accurate redundant import checking.
For example unnecessary imports in std::prelude that can be eliminated:
```rust
use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly
use std::option::Option::None; //~ WARNING the item `None` is imported redundantly
```File tree
52 files changed
+283
-167
lines changed- compiler
- rustc_data_structures/src
- rustc_hir_analysis/src
- check
- structured_errors
- rustc_hir_typeck/src
- fn_ctxt
- rustc_infer/src/infer/error_reporting
- rustc_metadata/src/rmeta
- rustc_middle/src/mir
- rustc_resolve/src
- rustc_session/src
- rustc_span/src/source_map
- library/std/src/os/unix
- src/tools
- clippy/src
- rust-analyzer/crates
- hir-def/src
- body
- item_tree
- hir-ty/src
- diagnostics/match_check
- mir
- eval
- lower
- ide-assists/src/handlers
- ide-completion/src/completions/item_list
- ide-db/src
- rust-analyzer/src
- cli
- salsa
- salsa-macros/src
- src
- tests/ui
- lint
- unused
- use-redundant
- rust-2018
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
52 files changed
+283
-167
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 | - | ||
7 | + | ||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 | - | ||
36 | + | ||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| |||
60 | 60 |
| |
61 | 61 |
| |
62 | 62 |
| |
63 | - | ||
63 | + | ||
64 | 64 |
| |
65 | 65 |
| |
66 | 66 |
| |
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
74 | - | ||
74 | + | ||
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
| |||
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
142 | - | ||
142 | + | ||
143 | 143 |
| |
144 | 144 |
| |
145 | 145 |
| |
146 | - | ||
146 | + | ||
147 | 147 |
| |
148 | 148 |
| |
149 | 149 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 | - | ||
8 | + | ||
9 | 9 |
| |
10 | 10 |
| |
11 | - | ||
12 | 11 |
| |
13 | 12 |
| |
14 | 13 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | - | ||
2 | + | ||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | - | ||
2 | + | ||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
|
Lines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | - | ||
3 | - | ||
4 | - | ||
2 | + | ||
5 | 3 |
| |
6 | 4 |
| |
7 | 5 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
30 | - | ||
30 | + | ||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 | - | ||
16 | + | ||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 | - | ||
56 | + | ||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
8 | - | ||
8 | + | ||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 | - | ||
16 | + | ||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
|
0 commit comments