Open
Description
Code
#![recursion_limit = "5"]
#![allow(unconditional_recursion)]
fn quicksort<It, I>(i: I) -> Vec<i32>
where
It: Iterator<Item = i32>,
I: IntoIterator<IntoIter = It>,
{
quicksort(i.into_iter().filter(|_| true))
}
pub fn bar(xs: Vec<i32>) -> Vec<i32> {
quicksort(xs)
}
Current output
relevant error:
error[E0275]: overflow evaluating the requirement `Filter<Filter<Filter<Filter<Filter<std::vec::IntoIter<i32>, ...>, ...>, ...>, ...>, ...>: Iterator`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "10"]` attribute to your crate (`qsort`)
= note: required for `Filter<Filter<Filter<Filter<Filter<std::vec::IntoIter<i32>, {closure@src/lib.rs:8:36: 8:39}>, {closure@src/lib.rs:8:36: 8:39}>, {closure@src/lib.rs:8:36: 8:39}>, {closure@src/lib.rs:8:36: 8:39}>, {closure@src/lib.rs:8:36: 8:39}>` to implement `IntoIterator`
Desired output
something-something infinite recursion
Rationale and extra context
Suggestion to increase recursion limit is wrong
Other cases
No response
Rust Version
rustc 1.76.0 (07dca489a 2024-02-04)
binary: rustc
commit-hash: 07dca489ac2d933c78d3c5158e3f43beefeb02ce
commit-date: 2024-02-04
host: x86_64-unknown-linux-gnu
release: 1.76.0
LLVM version: 17.0.6
Anything else?
No response
Metadata
Metadata
Assignees
Labels
Area: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Messages for errors, warnings, and lintsArea: Trait systemDiagnostics: Confusing error or lint that should be reworked.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.Relevant to the compiler team, which will review and decide on the PR/issue.Fixed by the next-generation trait solver, `-Znext-solver`.