-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-trait-systemArea: Trait systemArea: Trait systemD-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.Fixed by the next-generation trait solver, `-Znext-solver`.
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
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-trait-systemArea: Trait systemArea: Trait systemD-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.D-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.Fixed by the next-generation trait solver, `-Znext-solver`.