rust/src/test/run-pass/borrow-by-val-method-receiver.rs
Patrick Walton 5573ad723f rustc: Fix an LLVM assertion that tripped when borrowing a by-val method receiver.
In certain lvalue code paths, the type of the borrowed value was not
being used to generate temporary spills. I'm a bit surprised we didn't
hit this sooner.
2012-09-03 15:59:10 -07:00

14 lines
143 B
Rust

trait Foo {
fn foo(self);
}
impl &[int]: Foo {
fn foo(self) {}
}
fn main() {
let items = ~[ 3, 5, 1, 2, 4 ];
items.foo();
}