mode: reset mode on entry to fn body.

This is an interim fix to address the "Beware!" unsoundness.  I have a
more comprehensive rewrite of mode.rs in the pipeline.

r=pcwalton
This commit is contained in:
Niko Matsakis 2013-01-10 06:29:26 -08:00
parent eaa256509e
commit 737e115646
17 changed files with 69 additions and 41 deletions

View file

@ -15,7 +15,7 @@ fn main() {
let carrots = @~"crunchy";
fn@(tasties: @~str, macerate: fn(~str)) {
macerate(*tasties);
macerate(copy *tasties);
} (carrots, |food| {
let mush = food + cheese;
let f = fn@() {