]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/import-trait-for-method-call.stderr
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / import-trait-for-method-call.stderr
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   --> $SRC_DIR/core/src/hash/mod.rs:LL:COL
7    |
8    = note: the method is available for `DefaultHasher` here
9    |
10    = help: items from traits can only be used if the trait is in scope
11 help: the following trait is implemented but not in scope; perhaps add a `use` for it:
12    |
13 LL | use std::hash::Hasher;
14    |
15
16 error[E0599]: the method `as_ref` exists for reference `&dyn Bar`, but its trait bounds were not satisfied
17   --> $DIR/import-trait-for-method-call.rs:15:7
18    |
19 LL | trait Bar {}
20    | --------- doesn't satisfy `dyn Bar: AsRef<_>`
21 ...
22 LL |     x.as_ref();
23    |       ^^^^^^ method cannot be called on `&dyn Bar` due to unsatisfied trait bounds
24    |
25    = note: the following trait bounds were not satisfied:
26            `dyn Bar: AsRef<_>`
27            which is required by `&dyn Bar: AsRef<_>`
28    = help: items from traits can only be used if the trait is implemented and in scope
29    = note: the following trait defines an item `as_ref`, perhaps you need to implement it:
30            candidate #1: `AsRef`
31
32 error: aborting due to 2 previous errors
33
34 For more information about this error, try `rustc --explain E0599`.