Skip to content

error: internal compiler error: create_function: unexpected sort of node #3708

Closed
@ashee

Description

@ashee

my environment

amitava:l2 amitava$ uname -a
Darwin amitava.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64
amitava:l2 amitava$ rustc --version
rustc 0.4 (c3f9b72 2012-09-30 21:35:32 -0700)
host: x86_64-apple-darwin

This error is generated only with the rustc -g option.

source code

// struct-test.rs

use io::println;

fn main() {
  // define struct
  struct Bomb {
    timer: uint,

    // destructor
    drop {
      for iter::repeat(self.timer) {
        println("bam");
      }
    }
   }

  // use Bomb
  let x = 10;
  match x {
    10 => { let b = Bomb{timer:10}; println(fmt!("%?", b)); }
    _ => { println("not 10") }
  }
}

compile with -g option (error)

amitava:l2 amitava$ rustc -g struct-test.rs 
error: internal compiler error: create_function: unexpected sort of node

compile without -g option (no error)

amitava:l2 amitava$ rustc struct-test.rs
warning: no debug symbols in executable (-arch x86_64)
amitava:l2 amitava$ ./struct-test
{ timer: 10 }
bam
bam
bam
bam
bam
bam
bam
bam
bam
bam

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions