You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.