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