summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/format-borrow.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /tests/ui/suggestions/format-borrow.stderr
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/suggestions/format-borrow.stderr')
-rw-r--r--tests/ui/suggestions/format-borrow.stderr75
1 files changed, 75 insertions, 0 deletions
diff --git a/tests/ui/suggestions/format-borrow.stderr b/tests/ui/suggestions/format-borrow.stderr
new file mode 100644
index 000000000..8ed2b9c9a
--- /dev/null
+++ b/tests/ui/suggestions/format-borrow.stderr
@@ -0,0 +1,75 @@
+error[E0308]: mismatched types
+ --> $DIR/format-borrow.rs:2:21
+ |
+LL | let a: String = &String::from("a");
+ | ------ ^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
+ | |
+ | expected due to this
+ |
+help: consider removing the borrow
+ |
+LL - let a: String = &String::from("a");
+LL + let a: String = String::from("a");
+ |
+help: alternatively, consider changing the type annotation
+ |
+LL | let a: &String = &String::from("a");
+ | +
+
+error[E0308]: mismatched types
+ --> $DIR/format-borrow.rs:4:21
+ |
+LL | let b: String = &format!("b");
+ | ------ ^^^^^^^^^^^^^ expected struct `String`, found `&String`
+ | |
+ | expected due to this
+ |
+help: consider removing the borrow
+ |
+LL - let b: String = &format!("b");
+LL + let b: String = format!("b");
+ |
+help: alternatively, consider changing the type annotation
+ |
+LL | let b: &String = &format!("b");
+ | +
+
+error[E0308]: mismatched types
+ --> $DIR/format-borrow.rs:6:21
+ |
+LL | let c: String = &mut format!("c");
+ | ------ ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
+ | |
+ | expected due to this
+ |
+help: consider removing the borrow
+ |
+LL - let c: String = &mut format!("c");
+LL + let c: String = format!("c");
+ |
+help: alternatively, consider changing the type annotation
+ |
+LL | let c: &mut String = &mut format!("c");
+ | ++++
+
+error[E0308]: mismatched types
+ --> $DIR/format-borrow.rs:8:21
+ |
+LL | let d: String = &mut (format!("d"));
+ | ------ ^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
+ | |
+ | expected due to this
+ |
+help: consider removing the borrow
+ |
+LL - let d: String = &mut (format!("d"));
+LL + let d: String = format!("d"));
+ |
+help: alternatively, consider changing the type annotation
+ |
+LL | let d: &mut String = &mut (format!("d"));
+ | ++++
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0308`.