Skip to content

assertion failed: !borrow_list.is_empty() #8675

Closed
@metajack

Description

@metajack

@kmcallister found this bug in some Servo code.

The following code compiles but triggers an internal assertion and crashes:

struct Foo {
  bar: @mut Bar,
}

struct Bar {
  x: int,
}

fn main() {
  let foo1 = @mut Foo { bar: @mut Bar { x: 1 } };
  let foo2 = @mut Foo { bar: @mut Bar { x: 2 } };
  let foos = ~[foo1, foo2];

  for &@Foo { bar: ref bar } in foos.iter() {
  }
}

If you remove the ref in the pattern match, the code works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-lowLow priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions