diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-37311-type-length-limit/issue-37311.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.rs b/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.rs new file mode 100644 index 000000000..50d1f166c --- /dev/null +++ b/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.rs @@ -0,0 +1,23 @@ +// build-fail +// normalize-stderr-test: ".nll/" -> "/" + +trait Mirror { + type Image; +} + +impl<T> Mirror for T { type Image = T; } + +trait Foo { + fn recurse(&self); +} + +impl<T> Foo for T { + #[allow(unconditional_recursion)] + fn recurse(&self) { + (self, self).recurse(); //~ ERROR reached the recursion limit + } +} + +fn main() { + ().recurse(); +} |