We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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
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)];[];[]])
Obligation(predicate=<Items<'a, T> as TraitRef(Items<'a, T>, core::iter::Iterator)>::Item,depth=0)
RUST_BACKTRACE=1
The text was updated successfully, but these errors were encountered:
Possible duplicate of #20347
Sorry, something went wrong.
Looks like a dupe; thanks for filing!
In this case the fix is writing type Item = &'a T; in the body of the impl.
type Item = &'a T;
No branches or pull requests
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 forObligation(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 backtracethread 'rustc' panicked at 'Box', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:123
The text was updated successfully, but these errors were encountered: