]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/import-trait-for-method-call.rs
Rollup merge of #107255 - lcnr:implied-b-hr, r=oli-obk
[rust.git] / tests / ui / suggestions / import-trait-for-method-call.rs
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 trait Bar {}
10 impl Bar for String {}
11
12 fn main() {
13     let s = String::from("hey");
14     let x: &dyn Bar = &s;
15     x.as_ref(); //~ ERROR the method `as_ref` exists for reference `&dyn Bar`, but its trait bounds
16 }