summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/mut-borrow-needed-by-trait.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/ui/suggestions/mut-borrow-needed-by-trait.stderr
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/suggestions/mut-borrow-needed-by-trait.stderr')
-rw-r--r--tests/ui/suggestions/mut-borrow-needed-by-trait.stderr40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/ui/suggestions/mut-borrow-needed-by-trait.stderr b/tests/ui/suggestions/mut-borrow-needed-by-trait.stderr
new file mode 100644
index 000000000..6910b77d9
--- /dev/null
+++ b/tests/ui/suggestions/mut-borrow-needed-by-trait.stderr
@@ -0,0 +1,40 @@
+error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
+ --> $DIR/mut-borrow-needed-by-trait.rs:17:29
+ |
+LL | let fp = BufWriter::new(fp);
+ | -------------- ^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
+ | |
+ | required by a bound introduced by this call
+ |
+ = 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::<W>::new`
+ --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
+
+error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
+ --> $DIR/mut-borrow-needed-by-trait.rs:17:14
+ |
+LL | let fp = BufWriter::new(fp);
+ | ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
+ |
+ = 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
+
+error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn Write>`, but its trait bounds were not satisfied
+ --> $DIR/mut-borrow-needed-by-trait.rs:21:5
+ |
+LL | writeln!(fp, "hello world").unwrap();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `BufWriter<&dyn Write>` due to unsatisfied trait bounds
+ --> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
+ |
+ = note: doesn't satisfy `BufWriter<&dyn std::io::Write>: std::io::Write`
+ |
+ = note: the following trait bounds were not satisfied:
+ `&dyn std::io::Write: std::io::Write`
+ which is required by `BufWriter<&dyn std::io::Write>: std::io::Write`
+ = note: this error originates in the macro `writeln` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0277, E0599.
+For more information about an error, try `rustc --explain E0277`.