@@ -7,19 +7,6 @@ LL | let fp = BufWriter::new(fp);
7
7
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
8
8
= note: required by `BufWriter::<W>::new`
9
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
- ::: $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`
20
- |
21
- = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
22
-
23
10
error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
24
11
--> $DIR/mut-borrow-needed-by-trait.rs:17:14
25
12
|
@@ -34,7 +21,7 @@ LL | pub struct BufWriter<W: Write> {
34
21
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
35
22
36
23
error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn std::io::Write>`, but its trait bounds were not satisfied
37
- --> $DIR/mut-borrow-needed-by-trait.rs:22 :5
24
+ --> $DIR/mut-borrow-needed-by-trait.rs:21 :5
38
25
|
39
26
LL | writeln!(fp, "hello world").unwrap();
40
27
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `BufWriter<&dyn std::io::Write>` due to unsatisfied trait bounds
@@ -49,7 +36,7 @@ LL | pub struct BufWriter<W: Write> {
49
36
which is required by `BufWriter<&dyn std::io::Write>: std::io::Write`
50
37
= note: this error originates in the macro `writeln` (in Nightly builds, run with -Z macro-backtrace for more info)
51
38
52
- error: aborting due to 4 previous errors
39
+ error: aborting due to 3 previous errors
53
40
54
41
Some errors have detailed explanations: E0277, E0599.
55
42
For more information about an error, try `rustc --explain E0277`.
0 commit comments