From 3aaa3941fd62fb4aeea559eafe8a6aa6472eb87d Mon Sep 17 00:00:00 2001 From: Caio Date: Sun, 21 Apr 2024 15:43:43 -0300 Subject: Move some tests --- tests/ui/recursion/issue-23122-1.rs | 14 ++++++++++++++ tests/ui/recursion/issue-23122-1.stderr | 9 +++++++++ tests/ui/recursion/issue-23122-2.rs | 15 +++++++++++++++ tests/ui/recursion/issue-23122-2.stderr | 18 ++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 tests/ui/recursion/issue-23122-1.rs create mode 100644 tests/ui/recursion/issue-23122-1.stderr create mode 100644 tests/ui/recursion/issue-23122-2.rs create mode 100644 tests/ui/recursion/issue-23122-2.stderr (limited to 'tests/ui/recursion') diff --git a/tests/ui/recursion/issue-23122-1.rs b/tests/ui/recursion/issue-23122-1.rs new file mode 100644 index 00000000000..7fe0900ed5f --- /dev/null +++ b/tests/ui/recursion/issue-23122-1.rs @@ -0,0 +1,14 @@ +trait Next { + type Next: Next; +} + +struct GetNext { + t: T, +} + +impl Next for GetNext { + type Next = as Next>::Next; + //~^ ERROR overflow evaluating the requirement +} + +fn main() {} diff --git a/tests/ui/recursion/issue-23122-1.stderr b/tests/ui/recursion/issue-23122-1.stderr new file mode 100644 index 00000000000..c432a502c13 --- /dev/null +++ b/tests/ui/recursion/issue-23122-1.stderr @@ -0,0 +1,9 @@ +error[E0275]: overflow evaluating the requirement ` as Next>::Next == _` + --> $DIR/issue-23122-1.rs:10:17 + | +LL | type Next = as Next>::Next; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0275`. diff --git a/tests/ui/recursion/issue-23122-2.rs b/tests/ui/recursion/issue-23122-2.rs new file mode 100644 index 00000000000..2880b956417 --- /dev/null +++ b/tests/ui/recursion/issue-23122-2.rs @@ -0,0 +1,15 @@ +//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash" +trait Next { + type Next: Next; +} + +struct GetNext { + t: T, +} + +impl Next for GetNext { + type Next = as Next>::Next; + //~^ ERROR overflow evaluating the requirement +} + +fn main() {} diff --git a/tests/ui/recursion/issue-23122-2.stderr b/tests/ui/recursion/issue-23122-2.stderr new file mode 100644 index 00000000000..10463ab2c33 --- /dev/null +++ b/tests/ui/recursion/issue-23122-2.stderr @@ -0,0 +1,18 @@ +error[E0275]: overflow evaluating the requirement `<<<<<<<... as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next: Sized` + --> $DIR/issue-23122-2.rs:11:17 + | +LL | type Next = as Next>::Next; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_23122_2`) +note: required for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>` to implement `Next` + --> $DIR/issue-23122-2.rs:10:15 + | +LL | impl Next for GetNext { + | - ^^^^ ^^^^^^^^^^ + | | + | unsatisfied trait bound introduced here + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0275`. -- cgit 1.4.1-3-g733a5