about summary refs log tree commit diff
path: root/compiler/rustc_span/src/source_map
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-18 13:56:07 +0000
committerbors <bors@rust-lang.org>2024-02-18 13:56:07 +0000
commit8b21296b5db6d5724d6b8440dcf459fa82fd88b5 (patch)
tree65acaf8e7a0d42e30db5834ab49841ffe6ce1eb3 /compiler/rustc_span/src/source_map
parent6f726205a1b7992537ddec96c83f2b054b03e04f (diff)
parenta61126cef6c4083d57e22835033eb2eefdd31bac (diff)
downloadrust-8b21296b5db6d5724d6b8440dcf459fa82fd88b5.tar.gz
rust-8b21296b5db6d5724d6b8440dcf459fa82fd88b5.zip
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
```
Diffstat (limited to 'compiler/rustc_span/src/source_map')
-rw-r--r--compiler/rustc_span/src/source_map/tests.rs2
1 files changed, 0 insertions, 2 deletions
diff --git a/compiler/rustc_span/src/source_map/tests.rs b/compiler/rustc_span/src/source_map/tests.rs
index 51f8aa04e8a..81a9e470688 100644
--- a/compiler/rustc_span/src/source_map/tests.rs
+++ b/compiler/rustc_span/src/source_map/tests.rs
@@ -1,7 +1,5 @@
 use super::*;
 
-use rustc_data_structures::sync::FreezeLock;
-
 fn init_source_map() -> SourceMap {
     let sm = SourceMap::new(FilePathMapping::empty());
     sm.new_source_file(PathBuf::from("blork.rs").into(), "first line.\nsecond line".to_string());