-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 fictitious type in sizing_type_of() #23958
Labels
A-associated-items
Area: Associated items (types, constants & functions)
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Comments
nikomatsakis
added
the
A-associated-items
Area: Associated items (types, constants & functions)
label
Apr 1, 2015
jdm
added
the
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
label
Apr 1, 2015
Shorter example: trait Collection where for<'a> &'a Self: IntoIterator {
fn my_iter(&self) -> <&Self as IntoIterator>::IntoIter {
self.into_iter()
}
}
impl<T> Collection for [T] { }
fn main() {
let v = [0usize];
let _ = v.my_iter();
} |
Interesting, if the where clause is moved to my_iter method its works trait Collection {
fn my_iter<'a>(&'a self) -> <&'a Self as IntoIterator>::IntoIter where &'a Self: IntoIterator {
self.into_iter()
}
}
impl<T> Collection for [T] { }
fn main() {
let v = [0usize];
let _ = v.my_iter();
} |
It seems to be related with #23406. |
Closed
Ran into this with code like the below. The pub struct Foo(Vec<i32>);
impl Foo {
pub fn iter(&self) -> <&Self as IntoIterator>::IntoIter {
self.into_iter()
}
}
impl<'a> IntoIterator for &'a Foo {
type IntoIter = <&'a Vec<i32> as IntoIterator>::IntoIter;
type Item = <&'a Vec<i32> as IntoIterator>::Item;
fn into_iter(self) -> Self::IntoIter {
(&self.0).into_iter()
}
} |
eefriedman
added a commit
to eefriedman/rust
that referenced
this issue
Nov 14, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-associated-items
Area: Associated items (types, constants & functions)
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
This example causes an ICE:
Play: http://is.gd/pqOpJQ
output:
The text was updated successfully, but these errors were encountered: