@@ -5,13 +5,18 @@ LL | let fp = BufWriter::new(fp);
5
5
| ^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
6
6
|
7
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`
8
+ = note: required by `BufWriter::<W>::new`
9
9
10
10
error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
11
11
--> $DIR/mut-borrow-needed-by-trait.rs:17:14
12
12
|
13
13
LL | let fp = BufWriter::new(fp);
14
14
| ^^^^^^^^^^^^^^ 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`
15
20
|
16
21
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
17
22
@@ -20,18 +25,28 @@ error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satis
20
25
|
21
26
LL | let fp = BufWriter::new(fp);
22
27
| ^^^^^^^^^^^^^^^^^^ 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`
23
33
|
24
34
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
25
35
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
27
37
--> $DIR/mut-borrow-needed-by-trait.rs:22:5
28
38
|
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`
31
46
|
32
47
= note: the method `write_fmt` exists but the following trait bounds were not satisfied:
33
48
`&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`
35
50
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
36
51
37
52
error: aborting due to 4 previous errors
0 commit comments