]> git.proxmox.com Git - rustc.git/blame - src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / src / test / ui / suggestions / mut-borrow-needed-by-trait.stderr
CommitLineData
e74abb32 1error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
ba9703b0 2 --> $DIR/mut-borrow-needed-by-trait.rs:17:29
e74abb32
XL
3 |
4LL | let fp = BufWriter::new(fp);
5 | ^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
6 |
7 = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
1b1a35ee 8 = note: required by `BufWriter::<W>::new`
e74abb32
XL
9
10error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
ba9703b0 11 --> $DIR/mut-borrow-needed-by-trait.rs:17:14
e74abb32
XL
12 |
13LL | let fp = BufWriter::new(fp);
14 | ^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
ba9703b0 15 |
29967ef6 16 ::: $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
ba9703b0
XL
17 |
18LL | pub struct BufWriter<W: Write> {
1b1a35ee 19 | ----- required by this bound in `BufWriter`
e74abb32
XL
20 |
21 = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
e74abb32
XL
22
23error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
ba9703b0 24 --> $DIR/mut-borrow-needed-by-trait.rs:17:14
e74abb32
XL
25 |
26LL | let fp = BufWriter::new(fp);
27 | ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
ba9703b0 28 |
29967ef6 29 ::: $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
ba9703b0
XL
30 |
31LL | pub struct BufWriter<W: Write> {
1b1a35ee 32 | ----- required by this bound in `BufWriter`
e74abb32
XL
33 |
34 = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
e74abb32 35
1b1a35ee 36error[E0599]: no method named `write_fmt` found for struct `BufWriter<&dyn std::io::Write>` in the current scope
ba9703b0 37 --> $DIR/mut-borrow-needed-by-trait.rs:22:5
e74abb32
XL
38 |
39LL | writeln!(fp, "hello world").unwrap();
1b1a35ee 40 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `BufWriter<&dyn std::io::Write>`
74b04a01 41 |
29967ef6 42 ::: $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
74b04a01
XL
43 |
44LL | pub struct BufWriter<W: Write> {
1b1a35ee 45 | ------------------------------ doesn't satisfy `BufWriter<&dyn std::io::Write>: std::io::Write`
e74abb32
XL
46 |
47 = note: the method `write_fmt` exists but the following trait bounds were not satisfied:
74b04a01 48 `&dyn std::io::Write: std::io::Write`
1b1a35ee 49 which is required by `BufWriter<&dyn std::io::Write>: std::io::Write`
74b04a01 50 = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
e74abb32
XL
51
52error: aborting due to 4 previous errors
53
54Some errors have detailed explanations: E0277, E0599.
55For more information about an error, try `rustc --explain E0277`.