File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ use std:: hash:: BuildHasher ;
2+
3+ fn next_u64 ( ) -> u64 {
4+ let bh = std:: collections:: hash_map:: RandomState :: new ( ) ;
5+ let h = bh. build_hasher ( ) ;
6+ h. finish ( ) //~ ERROR no method named `finish` found for struct `DefaultHasher`
7+ }
8+
9+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0599]: no method named `finish` found for struct `DefaultHasher` in the current scope
2+ --> $DIR/import-trait-for-method-call.rs:6:7
3+ |
4+ LL | h.finish()
5+ | ^^^^^^ method not found in `DefaultHasher`
6+ |
7+ ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL
8+ |
9+ LL | fn finish(&self) -> u64;
10+ | ------
11+ | |
12+ | the method is available for `Box<DefaultHasher>` here
13+ | the method is available for `Box<&mut DefaultHasher>` here
14+ |
15+ help: consider wrapping the receiver expression with the appropriate type
16+ |
17+ LL | Box::new(h).finish()
18+ | ^^^^^^^^^ ^
19+ help: consider wrapping the receiver expression with the appropriate type
20+ |
21+ LL | Box::new(&mut h).finish()
22+ | ^^^^^^^^^^^^^ ^
23+
24+ error: aborting due to previous error
25+
26+ For more information about this error, try `rustc --explain E0599`.
You can’t perform that action at this time.
0 commit comments