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

17 lines
355 B
Rust
Raw Normal View History

// error-pattern:fail
fn main() {
let cheese = ~"roquefort";
let carrots = @~"crunchy";
fn@(tasties: @~str, macerate: fn(~str)) {
macerate(*tasties);
2012-06-30 18:19:07 -05:00
} (carrots, |food| {
let mush = food + cheese;
2012-01-10 08:49:15 -06:00
let f = fn@() {
let chew = mush + cheese;
fail ~"so yummy"
2012-01-10 08:49:15 -06:00
};
f();
});
}