]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/import-trait-for-method-call.rs
Merge commit '4a053f206fd6799a25823c307f7d7f9d897be118' into sync-rustfmt-subtree
[rust.git] / src / test / 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 }