-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
ICE: translate_substs returned a struct containing inference types/regions (specialization) #36848
Labels
A-specialization
Area: Trait impl specialization
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Comments
Aatch
added
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
A-specialization
Area: Trait impl specialization
labels
Sep 30, 2016
I got this ICE while trying to reduce #36804: #![feature(specialization)]
pub trait Iterator {
type Item;
fn next(&self) -> Option<Self::Item>;
}
impl<'a> Iterator for &'a () {
type Item = &'a u32;
fn next(&self) -> Option<&'a u32> { None }
}
pub struct Cloned<I>(I);
impl<'a, I, T: 'a> Iterator for Cloned<I>
where I: Iterator<Item=&'a T>, T: Clone
{
type Item = T;
fn next(&self) -> Option<T> { None }
}
impl<'a, I, T: 'a> Iterator for Cloned<I>
where I: Iterator<Item=&'a T>, T: Copy
{
}
fn main() {
Cloned(&()).next();
} |
I just got this as well. Am doing a bunch of stuff with monoidal patterns using Kinder. |
I tried adding this to (This is a specialization of the general case which is #[stable(feature = "rust1", since = "1.0.0")]
impl<'a, I: Iterator> Iterator for &'a mut I {
fn all<F>(&mut self, f: F) -> bool
where Self: Sized, F: FnMut(Self::Item) -> bool
{
(*self).all(f)
}
} And it results in the same kind of ICE:
|
arielb1
added a commit
to arielb1/rust
that referenced
this issue
Dec 8, 2016
Projections can generate lifetime variables with equality constraints, that will not be resolved by `resolve_type_vars_if_possible`, so substs need to be lifetime-erased after that. Fixes rust-lang#36848.
bors
added a commit
that referenced
this issue
Dec 11, 2016
erase lifetimes when translating specialized substs Projections can generate lifetime variables with equality constraints, that will not be resolved by `resolve_type_vars_if_possible`, so substs need to be lifetime-erased after that. Fixes #36848.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-specialization
Area: Trait impl specialization
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
When trying to compile #36791, I ran into the following ICE:
Backtrace:
Unfortunately, I don't have a minimal example to reproduce this that doesn't require rebuilding core.
The text was updated successfully, but these errors were encountered: