Recover trait import suggestion

This commit is contained in:
Esteban Küber 2021-04-23 18:12:54 -07:00
parent 862901781d
commit 64ee9cc28c
2 changed files with 6 additions and 1 deletions

View file

@ -1047,7 +1047,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
}
}
if !alt_rcvr_sugg && self.suggest_valid_traits(err, valid_out_of_scope_traits) {
if self.suggest_valid_traits(err, valid_out_of_scope_traits) {
return;
}

View file

@ -12,6 +12,7 @@ LL | fn finish(&self) -> u64;
| the method is available for `Box<DefaultHasher>` here
| the method is available for `Box<&mut DefaultHasher>` here
|
= help: items from traits can only be used if the trait is in scope
help: consider wrapping the receiver expression with the appropriate type
|
LL | Box::new(h).finish()
@ -20,6 +21,10 @@ help: consider wrapping the receiver expression with the appropriate type
|
LL | Box::new(&mut h).finish()
| ^^^^^^^^^^^^^ ^
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
LL | use std::hash::Hasher;
|
error: aborting due to previous error