2019-10-04 00:10:37 +00:00
|
|
|
error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
|
2020-04-01 01:10:13 +00:00
|
|
|
--> $DIR/mut-borrow-needed-by-trait.rs:17:29
|
2019-10-04 00:10:37 +00:00
|
|
|
|
|
|
|
|
LL | let fp = BufWriter::new(fp);
|
2021-09-07 11:30:53 +00:00
|
|
|
| -------------- ^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2019-10-04 00:10:37 +00:00
|
|
|
|
|
2019-10-04 00:39:58 +00:00
|
|
|
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
|
2021-10-05 23:04:09 +00:00
|
|
|
note: required by a bound in `BufWriter::<W>::new`
|
2021-07-17 18:13:50 +00:00
|
|
|
--> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
|
2019-10-04 00:10:37 +00:00
|
|
|
|
|
|
|
error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
|
2020-04-01 01:10:13 +00:00
|
|
|
--> $DIR/mut-borrow-needed-by-trait.rs:17:14
|
2019-10-04 00:10:37 +00:00
|
|
|
|
|
|
|
|
LL | let fp = BufWriter::new(fp);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
|
2021-06-10 11:52:00 +00:00
|
|
|
|
|
2021-07-31 16:26:55 +00:00
|
|
|
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
|
|
|
|
note: required by a bound in `BufWriter`
|
|
|
|
--> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
|
2019-10-04 00:10:37 +00:00
|
|
|
|
2022-12-14 00:57:34 +00:00
|
|
|
error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn Write>`, but its trait bounds were not satisfied
|
2023-03-14 22:01:14 +00:00
|
|
|
--> $DIR/mut-borrow-needed-by-trait.rs:21:14
|
2019-10-04 00:10:37 +00:00
|
|
|
|
|
2020-09-17 03:52:41 +00:00
|
|
|
LL | writeln!(fp, "hello world").unwrap();
|
2023-03-14 22:01:14 +00:00
|
|
|
| ---------^^---------------- method cannot be called on `BufWriter<&dyn Write>` due to unsatisfied trait bounds
|
2022-12-09 15:56:23 +00:00
|
|
|
--> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
|
2021-06-10 11:52:00 +00:00
|
|
|
|
|
2022-12-09 15:56:23 +00:00
|
|
|
= note: doesn't satisfy `BufWriter<&dyn std::io::Write>: std::io::Write`
|
2019-10-04 00:10:37 +00:00
|
|
|
|
|
2023-03-14 22:01:14 +00:00
|
|
|
note: must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method
|
|
|
|
--> $DIR/mut-borrow-needed-by-trait.rs:21:14
|
|
|
|
|
|
|
|
|
LL | writeln!(fp, "hello world").unwrap();
|
|
|
|
| ^^
|
2020-09-26 21:20:14 +00:00
|
|
|
= note: the following trait bounds were not satisfied:
|
2020-02-21 21:39:47 +00:00
|
|
|
`&dyn std::io::Write: std::io::Write`
|
2020-09-17 03:52:41 +00:00
|
|
|
which is required by `BufWriter<&dyn std::io::Write>: std::io::Write`
|
2019-10-04 00:10:37 +00:00
|
|
|
|
2021-05-20 14:15:56 +00:00
|
|
|
error: aborting due to 3 previous errors
|
2019-10-04 00:10:37 +00:00
|
|
|
|
|
|
|
Some errors have detailed explanations: E0277, E0599.
|
|
|
|
For more information about an error, try `rustc --explain E0277`.
|