]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr
Rollup merge of #105780 - GuillaumeGomez:read-more-links, r=notriddle
[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    |              required by a bound introduced by this call
8    |
9    = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
10 note: required by a bound in `BufWriter::<W>::new`
11   --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
12
13 error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
14   --> $DIR/mut-borrow-needed-by-trait.rs:17:14
15    |
16 LL |     let fp = BufWriter::new(fp);
17    |              ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
18    |
19    = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
20 note: required by a bound in `BufWriter`
21   --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
22
23 error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn Write>`, but its trait bounds were not satisfied
24   --> $DIR/mut-borrow-needed-by-trait.rs:21:5
25    |
26 LL |     writeln!(fp, "hello world").unwrap();
27    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `BufWriter<&dyn Write>` due to unsatisfied trait bounds
28   --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
29    |
30    = note: doesn't satisfy `BufWriter<&dyn std::io::Write>: std::io::Write`
31    |
32    = note: the following trait bounds were not satisfied:
33            `&dyn std::io::Write: std::io::Write`
34            which is required by `BufWriter<&dyn std::io::Write>: std::io::Write`
35    = note: this error originates in the macro `writeln` (in Nightly builds, run with -Z macro-backtrace for more info)
36
37 error: aborting due to 3 previous errors
38
39 Some errors have detailed explanations: E0277, E0599.
40 For more information about an error, try `rustc --explain E0277`.