@@ -5,13 +5,18 @@ LL | let fp = BufWriter::new(fp);
55 | ^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
66 |
77 = 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`
8+ = note: required by `BufWriter::<W>::new`
99
1010error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
1111 --> $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`
15+ |
16+ ::: $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
17+ |
18+ LL | pub struct BufWriter<W: Write> {
19+ | ----- required by this bound in `BufWriter`
1520 |
1621 = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
1722
@@ -20,18 +25,28 @@ error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satis
2025 |
2126LL | let fp = BufWriter::new(fp);
2227 | ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
28+ |
29+ ::: $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
30+ |
31+ LL | pub struct BufWriter<W: Write> {
32+ | ----- required by this bound in `BufWriter`
2333 |
2434 = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
2535
26- error[E0599]: no method named `write_fmt` found for struct `std::io:: BufWriter<&dyn std::io::Write>` in the current scope
36+ error[E0599]: no method named `write_fmt` found for struct `BufWriter<&dyn std::io::Write>` in the current scope
2737 --> $DIR/mut-borrow-needed-by-trait.rs:22:5
2838 |
29- LL | writeln!(fp, "hello world").unwrap();
30- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `std::io::BufWriter<&dyn std::io::Write>`
39+ LL | writeln!(fp, "hello world").unwrap();
40+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `BufWriter<&dyn std::io::Write>`
41+ |
42+ ::: $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
43+ |
44+ LL | pub struct BufWriter<W: Write> {
45+ | ------------------------------ doesn't satisfy `BufWriter<&dyn std::io::Write>: std::io::Write`
3146 |
3247 = note: the method `write_fmt` exists but the following trait bounds were not satisfied:
3348 `&dyn std::io::Write: std::io::Write`
34- which is required by `std::io:: BufWriter<&dyn std::io::Write>: std::io::Write`
49+ which is required by `BufWriter<&dyn std::io::Write>: std::io::Write`
3550 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
3651
3752error: aborting due to 4 previous errors
0 commit comments