summaryrefslogtreecommitdiffstats
path: root/src/test/ui/dst/dst-bad-coercions.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/dst/dst-bad-coercions.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/test/ui/dst/dst-bad-coercions.stderr80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/test/ui/dst/dst-bad-coercions.stderr b/src/test/ui/dst/dst-bad-coercions.stderr
new file mode 100644
index 000000000..01f862ed5
--- /dev/null
+++ b/src/test/ui/dst/dst-bad-coercions.stderr
@@ -0,0 +1,80 @@
+error[E0308]: mismatched types
+ --> $DIR/dst-bad-coercions.rs:14:17
+ |
+LL | let y: &S = x;
+ | -- ^ expected `&S`, found *-ptr
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&S`
+ found raw pointer `*const S`
+
+error[E0308]: mismatched types
+ --> $DIR/dst-bad-coercions.rs:15:21
+ |
+LL | let y: &dyn T = x;
+ | ------ ^ expected `&dyn T`, found *-ptr
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn T`
+ found raw pointer `*const S`
+
+error[E0308]: mismatched types
+ --> $DIR/dst-bad-coercions.rs:19:17
+ |
+LL | let y: &S = x;
+ | -- ^ expected `&S`, found *-ptr
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&S`
+ found raw pointer `*mut S`
+
+error[E0308]: mismatched types
+ --> $DIR/dst-bad-coercions.rs:20:21
+ |
+LL | let y: &dyn T = x;
+ | ------ ^ expected `&dyn T`, found *-ptr
+ | |
+ | expected due to this
+ |
+ = note: expected reference `&dyn T`
+ found raw pointer `*mut S`
+
+error[E0308]: mismatched types
+ --> $DIR/dst-bad-coercions.rs:23:25
+ |
+LL | let x: &mut dyn T = &S;
+ | ---------- ^^ types differ in mutability
+ | |
+ | expected due to this
+ |
+ = note: expected mutable reference `&mut dyn T`
+ found reference `&S`
+
+error[E0308]: mismatched types
+ --> $DIR/dst-bad-coercions.rs:24:25
+ |
+LL | let x: *mut dyn T = &S;
+ | ---------- ^^ types differ in mutability
+ | |
+ | expected due to this
+ |
+ = note: expected raw pointer `*mut dyn T`
+ found reference `&S`
+
+error[E0308]: mismatched types
+ --> $DIR/dst-bad-coercions.rs:25:21
+ |
+LL | let x: *mut S = &S;
+ | ------ ^^ types differ in mutability
+ | |
+ | expected due to this
+ |
+ = note: expected raw pointer `*mut S`
+ found reference `&S`
+
+error: aborting due to 7 previous errors
+
+For more information about this error, try `rustc --explain E0308`.