]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr
Rollup merge of #65276 - varkor:toolstate-no-ping, r=Mark-Simulacrum
[rust.git] / src / test / ui / suggestions / mut-borrow-needed-by-trait.stderr
1 error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
2   --> $DIR/mut-borrow-needed-by-trait.rs:17:29
3    |
4 LL |     let fp = BufWriter::new(fp);
5    |                             ^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
6    |
7    = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
8    = note: required by `std::io::BufWriter::<W>::new`
9
10 error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
11   --> $DIR/mut-borrow-needed-by-trait.rs:17:14
12    |
13 LL |     let fp = BufWriter::new(fp);
14    |              ^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
15    |
16    = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
17    = note: required by `std::io::BufWriter`
18
19 error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
20   --> $DIR/mut-borrow-needed-by-trait.rs:17:14
21    |
22 LL |     let fp = BufWriter::new(fp);
23    |              ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
24    |
25    = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
26    = note: required by `std::io::BufWriter`
27
28 error[E0599]: no method named `write_fmt` found for type `std::io::BufWriter<&dyn std::io::Write>` in the current scope
29   --> $DIR/mut-borrow-needed-by-trait.rs:22:5
30    |
31 LL |     writeln!(fp, "hello world").unwrap();
32    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `std::io::BufWriter<&dyn std::io::Write>`
33    |
34    = note: the method `write_fmt` exists but the following trait bounds were not satisfied:
35            `std::io::BufWriter<&dyn std::io::Write> : std::io::Write`
36    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
37
38 error: aborting due to 4 previous errors
39
40 Some errors have detailed explanations: E0277, E0599.
41 For more information about an error, try `rustc --explain E0277`.