forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#84499 - estebank:issue-84272, r=jackh726
Tweak trait not `use`d suggestion Fix rust-lang#84272. Follow up to rust-lang#83667.
- Loading branch information
Showing
10 changed files
with
96 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use std::hash::BuildHasher; | ||
|
||
fn next_u64() -> u64 { | ||
let bh = std::collections::hash_map::RandomState::new(); | ||
let h = bh.build_hasher(); | ||
h.finish() //~ ERROR no method named `finish` found for struct `DefaultHasher` | ||
} | ||
|
||
fn main() {} |
20 changes: 20 additions & 0 deletions
20
src/test/ui/suggestions/import-trait-for-method-call.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error[E0599]: no method named `finish` found for struct `DefaultHasher` in the current scope | ||
--> $DIR/import-trait-for-method-call.rs:6:7 | ||
| | ||
LL | h.finish() | ||
| ^^^^^^ method not found in `DefaultHasher` | ||
| | ||
::: $SRC_DIR/core/src/hash/mod.rs:LL:COL | ||
| | ||
LL | fn finish(&self) -> u64; | ||
| ------ the method is available for `DefaultHasher` here | ||
| | ||
= help: items from traits can only be used if the trait is in scope | ||
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 | ||
|
||
For more information about this error, try `rustc --explain E0599`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters