-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-type-systemArea: Type systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-monomorphizationIssue: An error at monomorphization time.Issue: An error at monomorphization time.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.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
This little program gives a "reached the recursion limit during monomorphization" error.
fn main() {
go(range(0, 5u));
}
fn go<T>(it: T) where T: Iterator<uint> {
let mut p = it;
match p.next() {
Some(_) => {
go(p.by_ref());
}
None => {}
}
}
The recursion limit is reached due to wrapping the iterator into ByRefs for every recursion step. IRC suggested that this could be a bug as this should be caught before monomorphization.
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-monomorphizationIssue: An error at monomorphization time.Issue: An error at monomorphization time.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.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.