rust/src/test/run-pass/issue-2633.rs

22 lines
363 B
Rust
Raw Normal View History

2012-08-15 20:46:55 -05:00
struct cat {
2012-09-06 21:40:15 -05:00
mut meow: fn@(),
2012-09-05 17:58:43 -05:00
}
fn cat() -> cat {
cat {
meow: fn@() { error!("meow"); }
}
2012-06-15 19:32:59 -05:00
}
type kitty_info = {kitty: cat};
// Code compiles and runs successfully if we add a + before the first arg
fn nyan(kitty: cat, _kitty_info: kitty_info) {
kitty.meow();
}
fn main() {
let mut kitty = cat();
nyan(kitty, {kitty: kitty});
}