From 20431706a863f92cb37dc512fef6e48d192aaf2c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/structs-enums/struct-rec/issue-74224.stderr | 4 +- .../ui/structs-enums/struct-rec/issue-84611.stderr | 4 +- .../struct-rec/mutual-struct-recursion.rs | 6 +-- .../struct-rec/mutual-struct-recursion.stderr | 62 +++++++++------------- 4 files changed, 32 insertions(+), 44 deletions(-) (limited to 'src/test/ui/structs-enums/struct-rec') diff --git a/src/test/ui/structs-enums/struct-rec/issue-74224.stderr b/src/test/ui/structs-enums/struct-rec/issue-74224.stderr index 619917846..f1d50bc8a 100644 --- a/src/test/ui/structs-enums/struct-rec/issue-74224.stderr +++ b/src/test/ui/structs-enums/struct-rec/issue-74224.stderr @@ -2,12 +2,12 @@ error[E0072]: recursive type `A` has infinite size --> $DIR/issue-74224.rs:1:1 | LL | struct A { - | ^^^^^^^^^^^ recursive type has infinite size + | ^^^^^^^^^^^ ... LL | y: A>, | ------- recursive without indirection | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `A` representable +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle | LL | y: Box>>, | ++++ + diff --git a/src/test/ui/structs-enums/struct-rec/issue-84611.stderr b/src/test/ui/structs-enums/struct-rec/issue-84611.stderr index 2e99435e0..536f54e3e 100644 --- a/src/test/ui/structs-enums/struct-rec/issue-84611.stderr +++ b/src/test/ui/structs-enums/struct-rec/issue-84611.stderr @@ -2,12 +2,12 @@ error[E0072]: recursive type `Foo` has infinite size --> $DIR/issue-84611.rs:1:1 | LL | struct Foo { - | ^^^^^^^^^^^^^ recursive type has infinite size + | ^^^^^^^^^^^^^ LL | LL | x: Foo<[T; 1]>, | ----------- recursive without indirection | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle | LL | x: Box>, | ++++ + diff --git a/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.rs b/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.rs index cca97f43e..3bfce8b4f 100644 --- a/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.rs +++ b/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.rs @@ -1,22 +1,20 @@ struct A { -//~^ ERROR recursive type `A` has infinite size +//~^ ERROR recursive types `A` and `B` have infinite size x: T, y: B, } struct B { -//~^ ERROR recursive type `B` has infinite size z: A } struct C { -//~^ ERROR recursive type `C` has infinite size +//~^ ERROR recursive types `C` and `D` have infinite size x: T, y: Option>>, } struct D { -//~^ ERROR recursive type `D` has infinite size z: Option>>, } diff --git a/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr b/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr index 80a494f3f..881bc2819 100644 --- a/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr +++ b/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr @@ -1,59 +1,49 @@ -error[E0072]: recursive type `A` has infinite size +error[E0072]: recursive types `A` and `B` have infinite size --> $DIR/mutual-struct-recursion.rs:1:1 | LL | struct A { - | ^^^^^^^^^^^ recursive type has infinite size + | ^^^^^^^^^^^ ... LL | y: B, | ---- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `A` representable - | -LL | y: Box>, - | ++++ + - -error[E0072]: recursive type `B` has infinite size - --> $DIR/mutual-struct-recursion.rs:7:1 - | +... LL | struct B { - | ^^^^^^^^^^^ recursive type has infinite size -LL | + | ^^^^^^^^^^^ LL | z: A | ---- recursive without indirection | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `B` representable +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle + | +LL ~ y: Box>, +LL | } +LL | +LL | struct B { +LL ~ z: Box> | -LL | z: Box> - | ++++ + -error[E0072]: recursive type `C` has infinite size - --> $DIR/mutual-struct-recursion.rs:12:1 +error[E0072]: recursive types `C` and `D` have infinite size + --> $DIR/mutual-struct-recursion.rs:11:1 | LL | struct C { - | ^^^^^^^^^^^ recursive type has infinite size + | ^^^^^^^^^^^ ... LL | y: Option>>, - | -------------------- recursive without indirection - | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `C` representable - | -LL | y: Option>>>, - | ++++ + - -error[E0072]: recursive type `D` has infinite size - --> $DIR/mutual-struct-recursion.rs:18:1 - | + | ---- recursive without indirection +... LL | struct D { - | ^^^^^^^^^^^ recursive type has infinite size -LL | + | ^^^^^^^^^^^ LL | z: Option>>, - | -------------------- recursive without indirection + | ---- recursive without indirection + | +help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle | -help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `D` representable +LL ~ y: Option>>>, +LL | } +LL | +LL | struct D { +LL ~ z: Option>>>, | -LL | z: Option>>>, - | ++++ + -error: aborting due to 4 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0072`. -- cgit v1.2.3