Skip to content

Compiler error #20571

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

Closed
withoutboats opened this issue Jan 5, 2015 · 2 comments
Closed

Compiler error #20571

withoutboats opened this issue Jan 5, 2015 · 2 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@withoutboats
Copy link
Contributor

While updating some of my code to compile under the new updates to rust-nightly, I caused the compiler to panic. Here is the output of rustc -v:

src/lib.rs:420:1: 434:2 error: internal compiler error: impl VtableImpl(impl_def_id=DefId { krate: 0, node: 2045 }:Items<'a, T>.Iterator, substs=Substs[types=[[_];[];[]], regions=[['_#0r];[];[]]], nested=[[Obligation(predicate=Binder(TraitPredicate(TraitRef(T, core::kinds::Sized))),depth=1)];[];[]]) did not contain projection for Obligation(predicate=<Items<'a, T> as TraitRef(Items<'a, T>, core::iter::Iterator)>::Item,depth=0)
src/lib.rs:420 impl<'a, T> Iterator for Items<'a, T> {
src/lib.rs:421 #[inline]
src/lib.rs:422 fn next(&mut self) -> Option<&'a T> {
src/lib.rs:423 if self.tail + self.gtail - self.ghead == self.buff.len() { return None };
src/lib.rs:424 let tail = get_idx(self.tail, self.gtail - self.ghead, self.ghead);
src/lib.rs:425 self.tail += 1;
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with RUST_BACKTRACE=1 for a backtrace
thread 'rustc' panicked at 'Box', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:123

@oakes
Copy link

oakes commented Jan 5, 2015

Possible duplicate of #20347

@kmcallister kmcallister added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jan 5, 2015
@huonw
Copy link
Member

huonw commented Jan 6, 2015

Looks like a dupe; thanks for filing!

In this case the fix is writing type Item = &'a T; in the body of the impl.

@huonw huonw closed this as completed Jan 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants