blob: b070671cb250e4d1ee07f8d4fb2b7819ef40607b [file] [log] [blame]
// Test for a subtle failure computing kinds of cyclic types, in which
// temporary kinds wound up being stored in a cache and used later.
// See rustc::ty::type_contents() for more information.
struct List { key: isize, next: Option<Box<List>> }
fn foo(node: Box<List>) -> isize {
let r = match node.next {
Some(right) => consume(right),
None => 0
};
consume(node) + r //~ ERROR use of moved value: `node`
}
fn consume(v: Box<List>) -> isize {
v.key
}
fn main() {}