Skip to content

Commit 8629017

Browse files
committed
Add regression test
1 parent 481ba16 commit 8629017

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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`.

0 commit comments

Comments
 (0)