rust/src/test/run-fail/unwind-lambda.rs

17 lines
355 B
Rust

// error-pattern:fail
fn main() {
let cheese = ~"roquefort";
let carrots = @~"crunchy";
fn@(tasties: @~str, macerate: fn(~str)) {
macerate(*tasties);
} (carrots, |food| {
let mush = food + cheese;
let f = fn@() {
let chew = mush + cheese;
fail ~"so yummy"
};
f();
});
}