2019-10-03 19:10:37 -05:00
|
|
|
error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
|
2020-03-31 20:10:13 -05:00
|
|
|
--> $DIR/mut-borrow-needed-by-trait.rs:17:29
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
|
|
|
LL | let fp = BufWriter::new(fp);
|
|
|
|
| ^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
|
|
|
|
|
|
2019-10-03 19:39:58 -05:00
|
|
|
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
|
2020-09-02 02:40:56 -05:00
|
|
|
= note: required by `BufWriter::<W>::new`
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
|
|
error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
|
2020-03-31 20:10:13 -05:00
|
|
|
--> $DIR/mut-borrow-needed-by-trait.rs:17:14
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
|
|
|
LL | let fp = BufWriter::new(fp);
|
|
|
|
| ^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
|
2020-03-03 17:07:04 -06:00
|
|
|
|
|
2020-06-11 21:31:49 -05:00
|
|
|
::: $SRC_DIR/std/src/io/buffered.rs:LL:COL
|
2020-03-03 17:07:04 -06:00
|
|
|
|
|
|
|
|
LL | pub struct BufWriter<W: Write> {
|
2020-09-02 02:40:56 -05:00
|
|
|
| ----- required by this bound in `BufWriter`
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
2019-10-03 19:39:58 -05:00
|
|
|
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
|
|
error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
|
2020-03-31 20:10:13 -05:00
|
|
|
--> $DIR/mut-borrow-needed-by-trait.rs:17:14
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
|
|
|
LL | let fp = BufWriter::new(fp);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
|
2020-03-03 17:07:04 -06:00
|
|
|
|
|
2020-06-11 21:31:49 -05:00
|
|
|
::: $SRC_DIR/std/src/io/buffered.rs:LL:COL
|
2020-03-03 17:07:04 -06:00
|
|
|
|
|
|
|
|
LL | pub struct BufWriter<W: Write> {
|
2020-09-02 02:40:56 -05:00
|
|
|
| ----- required by this bound in `BufWriter`
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
2019-10-03 19:39:58 -05:00
|
|
|
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
|
2019-10-03 19:10:37 -05:00
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
error[E0599]: no method named `write_fmt` found for struct `BufWriter<&dyn std::io::Write>` in the current scope
|
2020-03-31 20:10:13 -05:00
|
|
|
--> $DIR/mut-borrow-needed-by-trait.rs:22:5
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
|
|
|
LL | writeln!(fp, "hello world").unwrap();
|
2020-09-02 02:40:56 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `BufWriter<&dyn std::io::Write>`
|
2020-02-18 19:53:25 -06:00
|
|
|
|
|
2020-06-11 21:31:49 -05:00
|
|
|
::: $SRC_DIR/std/src/io/buffered.rs:LL:COL
|
2020-02-18 19:53:25 -06:00
|
|
|
|
|
|
|
|
LL | pub struct BufWriter<W: Write> {
|
2020-09-02 02:40:56 -05:00
|
|
|
| ------------------------------ doesn't satisfy `BufWriter<&dyn std::io::Write>: std::io::Write`
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
|
|
|
= note: the method `write_fmt` exists but the following trait bounds were not satisfied:
|
2020-02-21 15:39:47 -06:00
|
|
|
`&dyn std::io::Write: std::io::Write`
|
2020-09-02 02:40:56 -05:00
|
|
|
which is required by `BufWriter<&dyn std::io::Write>: std::io::Write`
|
2019-12-16 07:56:47 -06:00
|
|
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
2019-10-03 19:10:37 -05:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|
|
|
|
Some errors have detailed explanations: E0277, E0599.
|
|
|
|
For more information about an error, try `rustc --explain E0277`.
|