11error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
2- --> $DIR/mut-borrow-needed-by-trait.rs:21 :29
2+ --> $DIR/mut-borrow-needed-by-trait.rs:17 :29
33 |
44LL | let fp = BufWriter::new(fp);
55 | ^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
@@ -8,7 +8,7 @@ LL | let fp = BufWriter::new(fp);
88 = note: required by `std::io::BufWriter::<W>::new`
99
1010error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
11- --> $DIR/mut-borrow-needed-by-trait.rs:21 :14
11+ --> $DIR/mut-borrow-needed-by-trait.rs:17 :14
1212 |
1313LL | let fp = BufWriter::new(fp);
1414 | ^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
@@ -17,7 +17,7 @@ LL | let fp = BufWriter::new(fp);
1717 = note: required by `std::io::BufWriter`
1818
1919error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
20- --> $DIR/mut-borrow-needed-by-trait.rs:21 :14
20+ --> $DIR/mut-borrow-needed-by-trait.rs:17 :14
2121 |
2222LL | let fp = BufWriter::new(fp);
2323 | ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
@@ -26,19 +26,13 @@ LL | let fp = BufWriter::new(fp);
2626 = note: required by `std::io::BufWriter`
2727
2828error[E0599]: no method named `write_fmt` found for struct `std::io::BufWriter<&dyn std::io::Write>` in the current scope
29- --> $DIR/mut-borrow-needed-by-trait.rs:26 :5
29+ --> $DIR/mut-borrow-needed-by-trait.rs:22 :5
3030 |
3131LL | writeln!(fp, "hello world").unwrap();
3232 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `std::io::BufWriter<&dyn std::io::Write>`
33- |
34- ::: $SRC_DIR/libstd/io/buffered.rs:LL:COL
35- |
36- LL | pub struct BufWriter<W: Write> {
37- | ------------------------------ this type doesn't satisfy the bound `std::io::Write`
3833 |
3934 = note: the method `write_fmt` exists but the following trait bounds were not satisfied:
4035 `&dyn std::io::Write: std::io::Write`
41- `std::io::BufWriter<&dyn std::io::Write>: std::io::Write`
4236 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
4337
4438error: aborting due to 4 previous errors
0 commit comments