Rollup merge of #73023 - ayushmishra2005:remove_noisy_suggestion, r=davidtwco
Remove noisy suggestion of hash_map Remove noisy suggestion of hash_map #72642 fixes #72642
This commit is contained in:
commit
e1cd8c41a5
|
@ -685,7 +685,9 @@ impl<'a> Resolver<'a> {
|
|||
Res::Def(DefKind::Ctor(..), did) => this.parent(did),
|
||||
_ => res.opt_def_id(),
|
||||
};
|
||||
candidates.push(ImportSuggestion { did, descr: res.descr(), path });
|
||||
if candidates.iter().all(|v: &ImportSuggestion| v.did != did) {
|
||||
candidates.push(ImportSuggestion { did, descr: res.descr(), path });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,12 +4,10 @@ error[E0433]: failed to resolve: use of undeclared type or module `HashMap`
|
|||
LL | let mut map = HashMap::new();
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
help: consider importing this struct
|
||||
|
|
||||
LL | use std::collections::HashMap;
|
||||
|
|
||||
LL | use std::collections::hash_map::HashMap;
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
@ -16,9 +16,7 @@ LL | Vec::new();
|
|||
| ^^^ not found in this scope
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: consider importing one of these items
|
||||
|
|
||||
LL | use std::prelude::v1::Vec;
|
||||
help: consider importing this struct
|
||||
|
|
||||
LL | use std::vec::Vec;
|
||||
|
|
||||
|
|
|
@ -30,11 +30,10 @@ LL | use std::fmt::Result;
|
|||
|
|
||||
LL | use std::io::Result;
|
||||
|
|
||||
LL | use std::prelude::v1::Result;
|
||||
|
|
||||
LL | use std::result::Result;
|
||||
|
|
||||
and 1 other candidate
|
||||
LL | use std::thread::Result;
|
||||
|
|
||||
|
||||
error[E0573]: expected type, found variant `Result`
|
||||
--> $DIR/issue-17546.rs:30:13
|
||||
|
@ -48,11 +47,10 @@ LL | use std::fmt::Result;
|
|||
|
|
||||
LL | use std::io::Result;
|
||||
|
|
||||
LL | use std::prelude::v1::Result;
|
||||
|
|
||||
LL | use std::result::Result;
|
||||
|
|
||||
and 1 other candidate
|
||||
LL | use std::thread::Result;
|
||||
|
|
||||
|
||||
error[E0573]: expected type, found variant `NoResult`
|
||||
--> $DIR/issue-17546.rs:35:15
|
||||
|
|
|
@ -15,12 +15,10 @@ error[E0404]: expected trait, found derive macro `Clone`
|
|||
LL | impl Clone for Test {}
|
||||
| ^^^^^ not a trait
|
||||
|
|
||||
help: consider importing one of these items instead
|
||||
help: consider importing this trait instead
|
||||
|
|
||||
LL | use std::clone::Clone;
|
||||
|
|
||||
LL | use std::prelude::v1::Clone;
|
||||
|
|
||||
|
||||
error[E0405]: cannot find trait `Iterator` in this scope
|
||||
--> $DIR/no-implicit-prelude-nested.rs:13:14
|
||||
|
@ -28,12 +26,10 @@ error[E0405]: cannot find trait `Iterator` in this scope
|
|||
LL | impl Iterator for Test {}
|
||||
| ^^^^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
help: consider importing this trait
|
||||
|
|
||||
LL | use std::iter::Iterator;
|
||||
|
|
||||
LL | use std::prelude::v1::Iterator;
|
||||
|
|
||||
|
||||
error[E0405]: cannot find trait `ToString` in this scope
|
||||
--> $DIR/no-implicit-prelude-nested.rs:14:14
|
||||
|
@ -41,9 +37,7 @@ error[E0405]: cannot find trait `ToString` in this scope
|
|||
LL | impl ToString for Test {}
|
||||
| ^^^^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
|
|
||||
LL | use std::prelude::v1::ToString;
|
||||
help: consider importing this trait
|
||||
|
|
||||
LL | use std::string::ToString;
|
||||
|
|
||||
|
@ -60,12 +54,10 @@ error[E0425]: cannot find function `drop` in this scope
|
|||
LL | drop(2)
|
||||
| ^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
help: consider importing this function
|
||||
|
|
||||
LL | use std::mem::drop;
|
||||
|
|
||||
LL | use std::prelude::v1::drop;
|
||||
|
|
||||
|
||||
error[E0405]: cannot find trait `Add` in this scope
|
||||
--> $DIR/no-implicit-prelude-nested.rs:23:10
|
||||
|
@ -84,12 +76,10 @@ error[E0404]: expected trait, found derive macro `Clone`
|
|||
LL | impl Clone for Test {}
|
||||
| ^^^^^ not a trait
|
||||
|
|
||||
help: consider importing one of these items instead
|
||||
help: consider importing this trait instead
|
||||
|
|
||||
LL | use std::clone::Clone;
|
||||
|
|
||||
LL | use std::prelude::v1::Clone;
|
||||
|
|
||||
|
||||
error[E0405]: cannot find trait `Iterator` in this scope
|
||||
--> $DIR/no-implicit-prelude-nested.rs:25:10
|
||||
|
@ -97,12 +87,10 @@ error[E0405]: cannot find trait `Iterator` in this scope
|
|||
LL | impl Iterator for Test {}
|
||||
| ^^^^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
help: consider importing this trait
|
||||
|
|
||||
LL | use std::iter::Iterator;
|
||||
|
|
||||
LL | use std::prelude::v1::Iterator;
|
||||
|
|
||||
|
||||
error[E0405]: cannot find trait `ToString` in this scope
|
||||
--> $DIR/no-implicit-prelude-nested.rs:26:10
|
||||
|
@ -110,9 +98,7 @@ error[E0405]: cannot find trait `ToString` in this scope
|
|||
LL | impl ToString for Test {}
|
||||
| ^^^^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
|
|
||||
LL | use std::prelude::v1::ToString;
|
||||
help: consider importing this trait
|
||||
|
|
||||
LL | use std::string::ToString;
|
||||
|
|
||||
|
@ -129,12 +115,10 @@ error[E0425]: cannot find function `drop` in this scope
|
|||
LL | drop(2)
|
||||
| ^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
help: consider importing this function
|
||||
|
|
||||
LL | use std::mem::drop;
|
||||
|
|
||||
LL | use std::prelude::v1::drop;
|
||||
|
|
||||
|
||||
error[E0405]: cannot find trait `Add` in this scope
|
||||
--> $DIR/no-implicit-prelude-nested.rs:38:14
|
||||
|
@ -153,12 +137,10 @@ error[E0404]: expected trait, found derive macro `Clone`
|
|||
LL | impl Clone for Test {}
|
||||
| ^^^^^ not a trait
|
||||
|
|
||||
help: consider importing one of these items instead
|
||||
help: consider importing this trait instead
|
||||
|
|
||||
LL | use std::clone::Clone;
|
||||
|
|
||||
LL | use std::prelude::v1::Clone;
|
||||
|
|
||||
|
||||
error[E0405]: cannot find trait `Iterator` in this scope
|
||||
--> $DIR/no-implicit-prelude-nested.rs:40:14
|
||||
|
@ -166,12 +148,10 @@ error[E0405]: cannot find trait `Iterator` in this scope
|
|||
LL | impl Iterator for Test {}
|
||||
| ^^^^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
help: consider importing this trait
|
||||
|
|
||||
LL | use std::iter::Iterator;
|
||||
|
|
||||
LL | use std::prelude::v1::Iterator;
|
||||
|
|
||||
|
||||
error[E0405]: cannot find trait `ToString` in this scope
|
||||
--> $DIR/no-implicit-prelude-nested.rs:41:14
|
||||
|
@ -179,9 +159,7 @@ error[E0405]: cannot find trait `ToString` in this scope
|
|||
LL | impl ToString for Test {}
|
||||
| ^^^^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
|
|
||||
LL | use std::prelude::v1::ToString;
|
||||
help: consider importing this trait
|
||||
|
|
||||
LL | use std::string::ToString;
|
||||
|
|
||||
|
@ -198,12 +176,10 @@ error[E0425]: cannot find function `drop` in this scope
|
|||
LL | drop(2)
|
||||
| ^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
help: consider importing this function
|
||||
|
|
||||
LL | use std::mem::drop;
|
||||
|
|
||||
LL | use std::prelude::v1::drop;
|
||||
|
|
||||
|
||||
error: aborting due to 18 previous errors
|
||||
|
||||
|
|
|
@ -15,12 +15,10 @@ error[E0404]: expected trait, found derive macro `Clone`
|
|||
LL | impl Clone for Test {}
|
||||
| ^^^^^ not a trait
|
||||
|
|
||||
help: consider importing one of these items instead
|
||||
help: consider importing this trait instead
|
||||
|
|
||||
LL | use std::clone::Clone;
|
||||
|
|
||||
LL | use std::prelude::v1::Clone;
|
||||
|
|
||||
|
||||
error[E0405]: cannot find trait `Iterator` in this scope
|
||||
--> $DIR/no-implicit-prelude.rs:12:6
|
||||
|
@ -28,12 +26,10 @@ error[E0405]: cannot find trait `Iterator` in this scope
|
|||
LL | impl Iterator for Test {}
|
||||
| ^^^^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
help: consider importing this trait
|
||||
|
|
||||
LL | use std::iter::Iterator;
|
||||
|
|
||||
LL | use std::prelude::v1::Iterator;
|
||||
|
|
||||
|
||||
error[E0405]: cannot find trait `ToString` in this scope
|
||||
--> $DIR/no-implicit-prelude.rs:13:6
|
||||
|
@ -41,9 +37,7 @@ error[E0405]: cannot find trait `ToString` in this scope
|
|||
LL | impl ToString for Test {}
|
||||
| ^^^^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
|
|
||||
LL | use std::prelude::v1::ToString;
|
||||
help: consider importing this trait
|
||||
|
|
||||
LL | use std::string::ToString;
|
||||
|
|
||||
|
@ -60,12 +54,10 @@ error[E0425]: cannot find function `drop` in this scope
|
|||
LL | drop(2)
|
||||
| ^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
help: consider importing this function
|
||||
|
|
||||
LL | use std::mem::drop;
|
||||
|
|
||||
LL | use std::prelude::v1::drop;
|
||||
|
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
@ -10,12 +10,10 @@ error[E0433]: failed to resolve: use of undeclared type or module `HashMap`
|
|||
LL | let x1 = HashMap::new();
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
help: consider importing this struct
|
||||
|
|
||||
LL | use std::collections::HashMap;
|
||||
|
|
||||
LL | use std::collections::hash_map::HashMap;
|
||||
|
|
||||
|
||||
error[E0412]: cannot find type `HashMap` in this scope
|
||||
--> $DIR/use_suggestion.rs:5:13
|
||||
|
@ -23,12 +21,10 @@ error[E0412]: cannot find type `HashMap` in this scope
|
|||
LL | let y1: HashMap;
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
help: consider importing this struct
|
||||
|
|
||||
LL | use std::collections::HashMap;
|
||||
|
|
||||
LL | use std::collections::hash_map::HashMap;
|
||||
|
|
||||
|
||||
error[E0412]: cannot find type `GooMap` in this scope
|
||||
--> $DIR/use_suggestion.rs:6:13
|
||||
|
|
|
@ -26,12 +26,10 @@ error[E0412]: cannot find type `HashMap` in this scope
|
|||
LL | type Dict<K, V> = HashMap<K, V>;
|
||||
| ^^^^^^^ not found in this scope
|
||||
|
|
||||
help: consider importing one of these items
|
||||
help: consider importing this struct
|
||||
|
|
||||
LL | use std::collections::HashMap;
|
||||
|
|
||||
LL | use std::collections::hash_map::HashMap;
|
||||
|
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
Loading…
Reference in New Issue