summaryrefslogtreecommitdiffstats
path: root/tests/ui/span/coerce-suggestions.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/span/coerce-suggestions.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/span/coerce-suggestions.stderr')
-rw-r--r--tests/ui/span/coerce-suggestions.stderr72
1 files changed, 72 insertions, 0 deletions
diff --git a/tests/ui/span/coerce-suggestions.stderr b/tests/ui/span/coerce-suggestions.stderr
new file mode 100644
index 000000000..db784d5fe
--- /dev/null
+++ b/tests/ui/span/coerce-suggestions.stderr
@@ -0,0 +1,72 @@
+error[E0308]: mismatched types
+ --> $DIR/coerce-suggestions.rs:7:20
+ |
+LL | let x: usize = String::new();
+ | ----- ^^^^^^^^^^^^^ expected `usize`, found struct `String`
+ | |
+ | expected due to this
+
+error[E0308]: mismatched types
+ --> $DIR/coerce-suggestions.rs:9:19
+ |
+LL | let x: &str = String::new();
+ | ---- ^^^^^^^^^^^^^
+ | | |
+ | | expected `&str`, found struct `String`
+ | | help: consider borrowing here: `&String::new()`
+ | expected due to this
+
+error[E0308]: mismatched types
+ --> $DIR/coerce-suggestions.rs:12:10
+ |
+LL | test(&y);
+ | ---- ^^ types differ in mutability
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected mutable reference `&mut String`
+ found reference `&String`
+note: function defined here
+ --> $DIR/coerce-suggestions.rs:1:4
+ |
+LL | fn test(_x: &mut String) {}
+ | ^^^^ ---------------
+
+error[E0308]: mismatched types
+ --> $DIR/coerce-suggestions.rs:14:11
+ |
+LL | test2(&y);
+ | ----- ^^ types differ in mutability
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected mutable reference `&mut i32`
+ found reference `&String`
+note: function defined here
+ --> $DIR/coerce-suggestions.rs:3:4
+ |
+LL | fn test2(_x: &mut i32) {}
+ | ^^^^^ ------------
+
+error[E0308]: mismatched types
+ --> $DIR/coerce-suggestions.rs:17:9
+ |
+LL | f = Box::new(f);
+ | ^^^^^^^^^^^ cyclic type of infinite size
+ |
+help: consider unboxing the value
+ |
+LL | f = *Box::new(f);
+ | +
+
+error[E0308]: mismatched types
+ --> $DIR/coerce-suggestions.rs:21:9
+ |
+LL | s = format!("foo");
+ | ^^^^^^^^^^^^^^ expected `&mut String`, found struct `String`
+ |
+ = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0308`.