fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.1 KiB44 linesraw
1error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
2  --> $DIR/mut-borrow-needed-by-trait.rs:17:29
3   |
4LL |     let fp = BufWriter::new(fp);
5   |              -------------- ^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
6   |              |
7   |              required by a bound introduced by this call
8   |
9   = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
10note: required by a bound in `BufWriter::<W>::new`
11  --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
12
13error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
14  --> $DIR/mut-borrow-needed-by-trait.rs:17:14
15   |
16LL |     let fp = BufWriter::new(fp);
17   |              ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
18   |
19   = note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
20note: required by a bound in `BufWriter`
21  --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
22
23error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn Write>`, but its trait bounds were not satisfied
24  --> $DIR/mut-borrow-needed-by-trait.rs:21:14
25   |
26LL |     writeln!(fp, "hello world").unwrap();
27   |     ---------^^---------------- method cannot be called on `BufWriter<&dyn Write>` due to unsatisfied trait bounds
28  --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
29   |
30   = note: doesn't satisfy `BufWriter<&dyn std::io::Write>: std::io::Write`
31   |
32note: must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method
33  --> $DIR/mut-borrow-needed-by-trait.rs:21:14
34   |
35LL |     writeln!(fp, "hello world").unwrap();
36   |              ^^
37   = note: the following trait bounds were not satisfied:
38           `&dyn std::io::Write: std::io::Write`
39           which is required by `BufWriter<&dyn std::io::Write>: std::io::Write`
40
41error: aborting due to 3 previous errors
42
43Some errors have detailed explanations: E0277, E0599.
44For more information about an error, try `rustc --explain E0277`.