rust/src/test/compile-fail/block-coerce-no.rs
Marijn Haverbeke fc6b7c8b38 Reformat for new mode syntax, step 1
Long lines were fixed in a very crude way, as I'll be following up
with another reformat in a bit.
2011-09-12 12:04:14 +02:00

14 lines
362 B
Rust

// error-pattern: mismatched types
// Make sure that fn-to-block coercion isn't incorrectly lifted over
// other tycons.
fn coerce(b: block()) -> fn() {
fn lol(f: fn(block()) -> fn(), g: block()) -> fn() { ret f(g); }
fn fn_id(f: fn()) -> fn() { ret f }
ret lol(fn_id, b);
}
fn main() { let i = 8; let f = coerce(block () { log_err i; }); f(); }