Skip to content

ICE with an @mut ~[T] vec #5275

@alexcrichton

Description

@alexcrichton

This program:

struct A {
  bar: @mut ~[int],
}

impl A {
  fn foo(&self) -> int {
    match 3 {
      _ => if true {
        fail!()
      } else {
        *self.bar.last() // bug is from this line
      }
    }
  }
}

fn main() {}

Causes this output:

$ rustc foo.rs        
error: internal compiler error: no enclosing scope with id 31

I tried minimizing it further, but I was unable to get it any smaller.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions