Skip to content

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

Closed
@jbcrail

Description

@jbcrail

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);
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions