Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalizes-to overflow with rigid alias with redundant bound #83

Closed
compiler-errors opened this issue Jan 8, 2024 · 2 comments
Closed

Comments

@compiler-errors
Copy link
Member

pub fn choice<I>(iter: I) -> Option<I::Item>
where
    I: IntoIterator,
    I::IntoIter: Iterator,
{
    todo!()
}
error[E0275]: overflow evaluating the requirement `<I as IntoIterator>::Item normalizes-to _`
 --> <source>:1:30
  |
1 | pub fn choice<I>(iter: I) -> Option<I::Item>
  |                              ^^^^^^^^^^^^^^^
  |
  = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`example`)
@compiler-errors
Copy link
Member Author

extracted from fastrand crate

@lcnr
Copy link
Contributor

lcnr commented Jan 9, 2024

Think this is #76

normalizing <I as IntoIterator>::Item uses the impl<T: Iterator> IntoIterator for T impl, I guess that tries to prove I: Iterator which tries alias-relate(I, <I as IntoIterator>::IntoIter) which has to normalize <I as IntoItertor>::IntoIter at which point we start a trivial cycle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants