From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/dst/dst-bad-coercions.stderr | 80 +++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 tests/ui/dst/dst-bad-coercions.stderr (limited to 'tests/ui/dst/dst-bad-coercions.stderr') diff --git a/tests/ui/dst/dst-bad-coercions.stderr b/tests/ui/dst/dst-bad-coercions.stderr new file mode 100644 index 000000000..0d6f4d020 --- /dev/null +++ b/tests/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 `*const S` + | | + | 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 `*const S` + | | + | 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 `*mut S` + | | + | 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 `*mut S` + | | + | 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`. -- cgit v1.2.3