-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// build-fail | ||
// error-pattern: overflow evaluating the requirement `(): Sized` | ||
// error-pattern: function cannot return without recursing | ||
|
||
// Regression test for #91949. | ||
// This hanged *forever* on 1.56, fixed by #90423. | ||
|
||
#![recursion_limit = "256"] | ||
|
||
struct Wrapped<T>(T); | ||
|
||
struct IteratorOfWrapped<T, I: Iterator<Item = T>>(I); | ||
|
||
impl<T, I: Iterator<Item = T>> Iterator for IteratorOfWrapped<T, I> { | ||
type Item = Wrapped<T>; | ||
fn next(&mut self) -> Option<Wrapped<T>> { | ||
self.0.next().map(Wrapped) | ||
} | ||
} | ||
|
||
fn recurse<T>(elements: T) -> Vec<char> | ||
where | ||
T: Iterator<Item = ()>, | ||
{ | ||
recurse(IteratorOfWrapped(elements).map(|t| t.0)) | ||
} | ||
|
||
fn main() { | ||
recurse(std::iter::empty()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
warning: function cannot return without recursing | ||
--> $DIR/issue-91949-hangs-on-recursion.rs:21:1 | ||
| | ||
LL | / fn recurse<T>(elements: T) -> Vec<char> | ||
LL | | where | ||
LL | | T: Iterator<Item = ()>, | ||
LL | | { | ||
LL | | recurse(IteratorOfWrapped(elements).map(|t| t.0)) | ||
| | ------------------------------------------------- recursive call site | ||
LL | | } | ||
| |_^ cannot return without recursing | ||
| | ||
= note: `#[warn(unconditional_recursion)]` on by default | ||
= help: a `loop` may express intention better if this is on purpose | ||
|
||
error[E0275]: overflow evaluating the requirement `(): Sized` | ||
| | ||
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "512"]` attribute to your crate (`issue_91949_hangs_on_recursion`) | ||
= note: required because of the requirements on the impl of `Iterator` for `std::iter::Empty<()>` | ||
= note: 171 redundant requirements hidden | ||
= note: required because of the requirements on the impl of `Iterator` for `IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), std::iter::Empty<()>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:25:45: 25:52]>>` | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0275`. |