]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #7244 : bblum/rust/once, r=nikomatsakis
authorbors <bors@rust-lang.org>
Sat, 29 Jun 2013 09:34:43 +0000 (02:34 -0700)
committerbors <bors@rust-lang.org>
Sat, 29 Jun 2013 09:34:43 +0000 (02:34 -0700)
@graydon suggested that once closures not be part of the language for 1.0, but that they might be hidden behind a -Z compile flag as an "experimental feature" in case people decide they need them.

Regardless of whether ```-Z once-fns``` is set, this PR will parse the ```once``` keyword and will prevent closures labelled with it from being called more than once. It will also permit moving out of captured vars in heap closures, just to let the runtime writers stop using ```Cell``` sooner. Setting ```-Z once-fns``` only toggles whether the move-out-from-capture privilege is also given for stack closures.

r? @nikomatsakis

1  2 
src/librustc/driver/session.rs
src/librustc/middle/borrowck/gather_loans/gather_moves.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/moves.rs

Simple merge
Simple merge