diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:59:35 +0000 |
commit | d1b2d29528b7794b41e66fc2136e395a02f8529b (patch) | |
tree | a4a17504b260206dec3cf55b2dca82929a348ac2 /tests/ui/coercion | |
parent | Releasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip |
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/coercion')
-rw-r--r-- | tests/ui/coercion/coerce-block-tail-83783.fixed | 13 | ||||
-rw-r--r-- | tests/ui/coercion/coerce-block-tail-83783.rs | 2 | ||||
-rw-r--r-- | tests/ui/coercion/coerce-block-tail-83783.stderr | 4 |
3 files changed, 18 insertions, 1 deletions
diff --git a/tests/ui/coercion/coerce-block-tail-83783.fixed b/tests/ui/coercion/coerce-block-tail-83783.fixed new file mode 100644 index 000000000..0df0a64ac --- /dev/null +++ b/tests/ui/coercion/coerce-block-tail-83783.fixed @@ -0,0 +1,13 @@ +// run-rustfix +// edition:2018 +fn _consume_reference<T: ?Sized>(_: &T) {} + +async fn _foo() { + _consume_reference::<i32>(&Box::new(7_i32)); + _consume_reference::<i32>(&*async { Box::new(7_i32) }.await); + //~^ ERROR mismatched types + _consume_reference::<[i32]>(&vec![7_i32]); + _consume_reference::<[i32]>(&async { vec![7_i32] }.await); +} + +fn main() { } diff --git a/tests/ui/coercion/coerce-block-tail-83783.rs b/tests/ui/coercion/coerce-block-tail-83783.rs index 18c8ae3bb..ee6036b4d 100644 --- a/tests/ui/coercion/coerce-block-tail-83783.rs +++ b/tests/ui/coercion/coerce-block-tail-83783.rs @@ -1,4 +1,4 @@ -// check-fail +// run-rustfix // edition:2018 fn _consume_reference<T: ?Sized>(_: &T) {} diff --git a/tests/ui/coercion/coerce-block-tail-83783.stderr b/tests/ui/coercion/coerce-block-tail-83783.stderr index d556d013b..da3c38777 100644 --- a/tests/ui/coercion/coerce-block-tail-83783.stderr +++ b/tests/ui/coercion/coerce-block-tail-83783.stderr @@ -6,6 +6,10 @@ LL | _consume_reference::<i32>(&async { Box::new(7_i32) }.await); | = note: expected type `i32` found struct `Box<i32>` +help: consider unboxing the value + | +LL | _consume_reference::<i32>(&*async { Box::new(7_i32) }.await); + | + error: aborting due to previous error |