From 246f239d9f40f633160f0c18f87a20922d4e77bb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:06:37 +0200 Subject: Merging debian version 1.65.0+dfsg1-2. Signed-off-by: Daniel Baumann --- src/test/ui/dst/dst-bad-coercions.stderr | 8 ++++---- src/test/ui/dst/dst-rvalue.rs | 6 ++---- src/test/ui/dst/dst-rvalue.stderr | 28 ++++++++++++++++++++-------- 3 files changed, 26 insertions(+), 16 deletions(-) (limited to 'src/test/ui/dst') diff --git a/src/test/ui/dst/dst-bad-coercions.stderr b/src/test/ui/dst/dst-bad-coercions.stderr index 01f862ed5..0d6f4d020 100644 --- a/src/test/ui/dst/dst-bad-coercions.stderr +++ b/src/test/ui/dst/dst-bad-coercions.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coercions.rs:14:17 | LL | let y: &S = x; - | -- ^ expected `&S`, found *-ptr + | -- ^ expected `&S`, found `*const S` | | | expected due to this | @@ -13,7 +13,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coercions.rs:15:21 | LL | let y: &dyn T = x; - | ------ ^ expected `&dyn T`, found *-ptr + | ------ ^ expected `&dyn T`, found `*const S` | | | expected due to this | @@ -24,7 +24,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coercions.rs:19:17 | LL | let y: &S = x; - | -- ^ expected `&S`, found *-ptr + | -- ^ expected `&S`, found `*mut S` | | | expected due to this | @@ -35,7 +35,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coercions.rs:20:21 | LL | let y: &dyn T = x; - | ------ ^ expected `&dyn T`, found *-ptr + | ------ ^ expected `&dyn T`, found `*mut S` | | | expected due to this | diff --git a/src/test/ui/dst/dst-rvalue.rs b/src/test/ui/dst/dst-rvalue.rs index b52a95a70..fbb32cac1 100644 --- a/src/test/ui/dst/dst-rvalue.rs +++ b/src/test/ui/dst/dst-rvalue.rs @@ -1,12 +1,10 @@ // Check that dynamically sized rvalues are forbidden -#![feature(box_syntax)] - pub fn main() { - let _x: Box = box *"hello world"; + let _x: Box = Box::new(*"hello world"); //~^ ERROR E0277 let array: &[isize] = &[1, 2, 3]; - let _x: Box<[isize]> = box *array; + let _x: Box<[isize]> = Box::new(*array); //~^ ERROR E0277 } diff --git a/src/test/ui/dst/dst-rvalue.stderr b/src/test/ui/dst/dst-rvalue.stderr index 15830636b..727f4d843 100644 --- a/src/test/ui/dst/dst-rvalue.stderr +++ b/src/test/ui/dst/dst-rvalue.stderr @@ -1,20 +1,32 @@ error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/dst-rvalue.rs:6:28 + --> $DIR/dst-rvalue.rs:4:33 | -LL | let _x: Box = box *"hello world"; - | ^^^^^^^^^^^^^^ doesn't have a size known at compile-time +LL | let _x: Box = Box::new(*"hello world"); + | -------- ^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | | + | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `str` - = note: the type of a box expression must have a statically known size +note: required by a bound in `Box::::new` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL + | +LL | impl Box { + | ^ required by this bound in `Box::::new` error[E0277]: the size for values of type `[isize]` cannot be known at compilation time - --> $DIR/dst-rvalue.rs:10:32 + --> $DIR/dst-rvalue.rs:8:37 | -LL | let _x: Box<[isize]> = box *array; - | ^^^^^^ doesn't have a size known at compile-time +LL | let _x: Box<[isize]> = Box::new(*array); + | -------- ^^^^^^ doesn't have a size known at compile-time + | | + | required by a bound introduced by this call | = help: the trait `Sized` is not implemented for `[isize]` - = note: the type of a box expression must have a statically known size +note: required by a bound in `Box::::new` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL + | +LL | impl Box { + | ^ required by this bound in `Box::::new` error: aborting due to 2 previous errors -- cgit v1.2.3