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

Internal compiler error: sequence_element_type called on non-sequence value #11736

Closed
jbcrail opened this issue Jan 22, 2014 · 1 comment
Closed
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@jbcrail
Copy link
Contributor

jbcrail commented Jan 22, 2014

Using rustc 0.9 on Ubuntu 13.10 (i686-unknown-linux-gnu), I received the error when compiling:

sieve.rs:10:7: 10:16 warning: variable does not need to be mutable, #[warn(unused_mut)] on by default
sieve.rs:10   let mut sieve = Bitv::new(n+1, true);
                  ^~~~~~~~~
error: internal compiler error: sequence_element_type called on non-sequence value
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
task 'rustc' failed at 'explicit failure', /home/joseph/rust-0.9/src/libsyntax/diagnostic.rs:75
task '<main>' failed at 'explicit failure', /home/joseph/rust-0.9/src/librustc/lib.rs:453

The offending source code is:

extern mod extra;
extern mod std;

use std::num;
use extra::bitv::Bitv;

fn main() {
  // Generate sieve of Eratosthenes for n up to 1e6
  let n = 1000000u;
  let mut sieve = Bitv::new(n+1, true);
  let limit: uint = num::sqrt(n as f32) as uint;
  for i in range(2, limit+1) {
    if sieve[i] {
      let mut j = 0;
      while i*i + j*i <= n {
        sieve[i*i+j*i] = false;
        j += 1;
      }
    }
  }
  for i in range(2, n+1) {
    if sieve[i] {
      println!("{}", i);
    }
  }
}
@jayanderson
Copy link
Contributor

A simpler example:

extern mod extra;
use extra::bitv::Bitv;

fn main() {
  let mut bits: ~Bitv = ~Bitv::new(5, false);
  bits[0] = true;
  //bits.set(0, true); // <-- What the above should be.
}

The code is wrong (though it'd be very nice if it weren't). However the compiler still has the error which should be fixed.

@huonw huonw added the I-ICE label Mar 1, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 16, 2023
Make SpanlessEq more consistent

1) Remove wildcard as requested in rust-lang/rust-clippy#10267.
2) Implement `hir_utils::eq_expr` for `ExprKind::Closure`, `ExprKind::ConstBlock`, `ExprKind::InlineAsm` and `ExprKind::Yield`.
3) Reorder branches of `hir_utils::eq_expr` to be in alphabetical order.

---
changelog: none
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

3 participants