diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 18:31:36 +0000 |
commit | e02c5b5930c2c9ba3e5423fe12e2ef0155017297 (patch) | |
tree | fd60ebbbb5299e16e5fca8c773ddb74f764760db /tests/ui/infinite | |
parent | Adding debian version 1.73.0+dfsg1-1. (diff) | |
download | rustc-e02c5b5930c2c9ba3e5423fe12e2ef0155017297.tar.xz rustc-e02c5b5930c2c9ba3e5423fe12e2ef0155017297.zip |
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/infinite')
-rw-r--r-- | tests/ui/infinite/infinite-type-alias-mutual-recursion.feature.stderr | 27 | ||||
-rw-r--r-- | tests/ui/infinite/infinite-type-alias-mutual-recursion.gated.stderr (renamed from tests/ui/infinite/infinite-type-alias-mutual-recursion.stderr) | 15 | ||||
-rw-r--r-- | tests/ui/infinite/infinite-type-alias-mutual-recursion.rs | 10 | ||||
-rw-r--r-- | tests/ui/infinite/infinite-vec-type-recursion.feature.stderr | 11 | ||||
-rw-r--r-- | tests/ui/infinite/infinite-vec-type-recursion.gated.stderr (renamed from tests/ui/infinite/infinite-vec-type-recursion.stderr) | 11 | ||||
-rw-r--r-- | tests/ui/infinite/infinite-vec-type-recursion.rs | 9 |
6 files changed, 70 insertions, 13 deletions
diff --git a/tests/ui/infinite/infinite-type-alias-mutual-recursion.feature.stderr b/tests/ui/infinite/infinite-type-alias-mutual-recursion.feature.stderr new file mode 100644 index 000000000..8b8fc46df --- /dev/null +++ b/tests/ui/infinite/infinite-type-alias-mutual-recursion.feature.stderr @@ -0,0 +1,27 @@ +error[E0275]: overflow evaluating the requirement `X2` + --> $DIR/infinite-type-alias-mutual-recursion.rs:6:11 + | +LL | type X1 = X2; + | ^^ + | + = note: in case this is a recursive type alias, consider using a struct, enum, or union instead + +error[E0275]: overflow evaluating the requirement `X3` + --> $DIR/infinite-type-alias-mutual-recursion.rs:9:11 + | +LL | type X2 = X3; + | ^^ + | + = note: in case this is a recursive type alias, consider using a struct, enum, or union instead + +error[E0275]: overflow evaluating the requirement `X1` + --> $DIR/infinite-type-alias-mutual-recursion.rs:11:11 + | +LL | type X3 = X1; + | ^^ + | + = note: in case this is a recursive type alias, consider using a struct, enum, or union instead + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0275`. diff --git a/tests/ui/infinite/infinite-type-alias-mutual-recursion.stderr b/tests/ui/infinite/infinite-type-alias-mutual-recursion.gated.stderr index bbdb1f70b..ec63688fa 100644 --- a/tests/ui/infinite/infinite-type-alias-mutual-recursion.stderr +++ b/tests/ui/infinite/infinite-type-alias-mutual-recursion.gated.stderr @@ -1,16 +1,16 @@ error[E0391]: cycle detected when expanding type alias `X1` - --> $DIR/infinite-type-alias-mutual-recursion.rs:1:11 + --> $DIR/infinite-type-alias-mutual-recursion.rs:6:11 | LL | type X1 = X2; | ^^ | note: ...which requires expanding type alias `X2`... - --> $DIR/infinite-type-alias-mutual-recursion.rs:3:11 + --> $DIR/infinite-type-alias-mutual-recursion.rs:9:11 | LL | type X2 = X3; | ^^ note: ...which requires expanding type alias `X3`... - --> $DIR/infinite-type-alias-mutual-recursion.rs:4:11 + --> $DIR/infinite-type-alias-mutual-recursion.rs:11:11 | LL | type X3 = X1; | ^^ @@ -19,12 +19,13 @@ LL | type X3 = X1; = help: consider using a struct, enum, or union instead to break the cycle = help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information note: cycle used when collecting item types in top-level module - --> $DIR/infinite-type-alias-mutual-recursion.rs:1:1 + --> $DIR/infinite-type-alias-mutual-recursion.rs:3:1 | -LL | / type X1 = X2; +LL | / #![cfg_attr(feature, feature(lazy_type_alias))] +LL | | #![allow(incomplete_features)] LL | | -LL | | type X2 = X3; -LL | | type X3 = X1; +LL | | type X1 = X2; +... | LL | | LL | | fn main() {} | |____________^ diff --git a/tests/ui/infinite/infinite-type-alias-mutual-recursion.rs b/tests/ui/infinite/infinite-type-alias-mutual-recursion.rs index 5381eedcf..90c941c63 100644 --- a/tests/ui/infinite/infinite-type-alias-mutual-recursion.rs +++ b/tests/ui/infinite/infinite-type-alias-mutual-recursion.rs @@ -1,6 +1,14 @@ +// revisions: feature gated + +#![cfg_attr(feature, feature(lazy_type_alias))] +#![allow(incomplete_features)] + type X1 = X2; -//~^ ERROR cycle detected when expanding type alias `X1` +//[gated]~^ ERROR cycle detected when expanding type alias `X1` +//[feature]~^^ ERROR: overflow evaluating the requirement `X2` type X2 = X3; +//[feature]~^ ERROR: overflow evaluating the requirement `X3` type X3 = X1; +//[feature]~^ ERROR: overflow evaluating the requirement `X1` fn main() {} diff --git a/tests/ui/infinite/infinite-vec-type-recursion.feature.stderr b/tests/ui/infinite/infinite-vec-type-recursion.feature.stderr new file mode 100644 index 000000000..3a1462159 --- /dev/null +++ b/tests/ui/infinite/infinite-vec-type-recursion.feature.stderr @@ -0,0 +1,11 @@ +error[E0275]: overflow evaluating the requirement `X` + --> $DIR/infinite-vec-type-recursion.rs:6:10 + | +LL | type X = Vec<X>; + | ^^^^^^ + | + = note: in case this is a recursive type alias, consider using a struct, enum, or union instead + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0275`. diff --git a/tests/ui/infinite/infinite-vec-type-recursion.stderr b/tests/ui/infinite/infinite-vec-type-recursion.gated.stderr index a21b033a9..e47d9b652 100644 --- a/tests/ui/infinite/infinite-vec-type-recursion.stderr +++ b/tests/ui/infinite/infinite-vec-type-recursion.gated.stderr @@ -1,5 +1,5 @@ error[E0391]: cycle detected when expanding type alias `X` - --> $DIR/infinite-vec-type-recursion.rs:1:14 + --> $DIR/infinite-vec-type-recursion.rs:6:14 | LL | type X = Vec<X>; | ^ @@ -9,11 +9,14 @@ LL | type X = Vec<X>; = help: consider using a struct, enum, or union instead to break the cycle = help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information note: cycle used when collecting item types in top-level module - --> $DIR/infinite-vec-type-recursion.rs:1:1 + --> $DIR/infinite-vec-type-recursion.rs:3:1 | -LL | / type X = Vec<X>; -LL | | +LL | / #![cfg_attr(feature, feature(lazy_type_alias))] +LL | | #![allow(incomplete_features)] LL | | +LL | | type X = Vec<X>; +... | +LL | | #[rustfmt::skip] LL | | fn main() { let b: X = Vec::new(); } | |____________________________________^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information diff --git a/tests/ui/infinite/infinite-vec-type-recursion.rs b/tests/ui/infinite/infinite-vec-type-recursion.rs index 356818225..71ab4a330 100644 --- a/tests/ui/infinite/infinite-vec-type-recursion.rs +++ b/tests/ui/infinite/infinite-vec-type-recursion.rs @@ -1,4 +1,11 @@ +// revisions: feature gated + +#![cfg_attr(feature, feature(lazy_type_alias))] +#![allow(incomplete_features)] + type X = Vec<X>; -//~^ ERROR cycle detected +//[gated]~^ ERROR cycle detected +//[feature]~^^ ERROR: overflow evaluating the requirement `X` +#[rustfmt::skip] fn main() { let b: X = Vec::new(); } |