Purge the old once_fns
, which are not coming back
This commit is contained in:
parent
3112771001
commit
091dc6e98a
8 changed files with 33 additions and 145 deletions
|
@ -38,7 +38,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
|
||||||
("globs", Active),
|
("globs", Active),
|
||||||
("macro_rules", Active),
|
("macro_rules", Active),
|
||||||
("struct_variant", Active),
|
("struct_variant", Active),
|
||||||
("once_fns", Active),
|
|
||||||
("asm", Active),
|
("asm", Active),
|
||||||
("managed_boxes", Removed),
|
("managed_boxes", Removed),
|
||||||
("non_ascii_idents", Active),
|
("non_ascii_idents", Active),
|
||||||
|
@ -307,11 +306,10 @@ impl<'a, 'v> Visitor<'v> for Context<'a> {
|
||||||
|
|
||||||
fn visit_ty(&mut self, t: &ast::Ty) {
|
fn visit_ty(&mut self, t: &ast::Ty) {
|
||||||
match t.node {
|
match t.node {
|
||||||
ast::TyClosure(ref closure) if closure.onceness == ast::Once => {
|
ast::TyClosure(ref closure) => {
|
||||||
self.gate_feature("once_fns", t.span,
|
// this used to be blocked by a feature gate, but it should just
|
||||||
"once functions are \
|
// be plain impossible right now
|
||||||
experimental and likely to be removed");
|
assert!(closure.onceness != ast::Once);
|
||||||
|
|
||||||
},
|
},
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -503,42 +503,41 @@ declare_special_idents_and_keywords! {
|
||||||
(27, Mod, "mod");
|
(27, Mod, "mod");
|
||||||
(28, Move, "move");
|
(28, Move, "move");
|
||||||
(29, Mut, "mut");
|
(29, Mut, "mut");
|
||||||
(30, Once, "once");
|
(30, Pub, "pub");
|
||||||
(31, Pub, "pub");
|
(31, Ref, "ref");
|
||||||
(32, Ref, "ref");
|
(32, Return, "return");
|
||||||
(33, Return, "return");
|
|
||||||
// Static and Self are also special idents (prefill de-dupes)
|
// Static and Self are also special idents (prefill de-dupes)
|
||||||
(super::STATIC_KEYWORD_NAME_NUM, Static, "static");
|
(super::STATIC_KEYWORD_NAME_NUM, Static, "static");
|
||||||
(super::SELF_KEYWORD_NAME_NUM, Self, "self");
|
(super::SELF_KEYWORD_NAME_NUM, Self, "self");
|
||||||
(34, Struct, "struct");
|
(33, Struct, "struct");
|
||||||
(super::SUPER_KEYWORD_NAME_NUM, Super, "super");
|
(super::SUPER_KEYWORD_NAME_NUM, Super, "super");
|
||||||
(35, True, "true");
|
(34, True, "true");
|
||||||
(36, Trait, "trait");
|
(35, Trait, "trait");
|
||||||
(37, Type, "type");
|
(36, Type, "type");
|
||||||
(38, Unsafe, "unsafe");
|
(37, Unsafe, "unsafe");
|
||||||
(39, Use, "use");
|
(38, Use, "use");
|
||||||
(40, Virtual, "virtual");
|
(39, Virtual, "virtual");
|
||||||
(41, While, "while");
|
(40, While, "while");
|
||||||
(42, Continue, "continue");
|
(41, Continue, "continue");
|
||||||
(43, Proc, "proc");
|
(42, Proc, "proc");
|
||||||
(44, Box, "box");
|
(43, Box, "box");
|
||||||
(45, Const, "const");
|
(44, Const, "const");
|
||||||
(46, Where, "where");
|
(45, Where, "where");
|
||||||
|
|
||||||
'reserved:
|
'reserved:
|
||||||
(47, Alignof, "alignof");
|
(46, Alignof, "alignof");
|
||||||
(48, Be, "be");
|
(47, Be, "be");
|
||||||
(49, Offsetof, "offsetof");
|
(48, Offsetof, "offsetof");
|
||||||
(50, Priv, "priv");
|
(49, Priv, "priv");
|
||||||
(51, Pure, "pure");
|
(50, Pure, "pure");
|
||||||
(52, Sizeof, "sizeof");
|
(51, Sizeof, "sizeof");
|
||||||
(53, Typeof, "typeof");
|
(52, Typeof, "typeof");
|
||||||
(54, Unsized, "unsized");
|
(53, Unsized, "unsized");
|
||||||
(55, Yield, "yield");
|
(54, Yield, "yield");
|
||||||
(56, Do, "do");
|
(55, Do, "do");
|
||||||
(57, Abstract, "abstract");
|
(56, Abstract, "abstract");
|
||||||
(58, Final, "final");
|
(57, Final, "final");
|
||||||
(59, Override, "override");
|
(58, Override, "override");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2663,12 +2663,10 @@ impl<'a> State<'a> {
|
||||||
} else if opt_sigil == Some('&') {
|
} else if opt_sigil == Some('&') {
|
||||||
try!(self.print_fn_style(fn_style));
|
try!(self.print_fn_style(fn_style));
|
||||||
try!(self.print_extern_opt_abi(opt_abi));
|
try!(self.print_extern_opt_abi(opt_abi));
|
||||||
try!(self.print_onceness(onceness));
|
|
||||||
} else {
|
} else {
|
||||||
assert!(opt_sigil.is_none());
|
assert!(opt_sigil.is_none());
|
||||||
try!(self.print_fn_style(fn_style));
|
try!(self.print_fn_style(fn_style));
|
||||||
try!(self.print_opt_abi_and_extern_if_nondefault(opt_abi));
|
try!(self.print_opt_abi_and_extern_if_nondefault(opt_abi));
|
||||||
try!(self.print_onceness(onceness));
|
|
||||||
try!(word(&mut self.s, "fn"));
|
try!(word(&mut self.s, "fn"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2987,13 +2985,6 @@ impl<'a> State<'a> {
|
||||||
ast::UnsafeFn => self.word_nbsp("unsafe"),
|
ast::UnsafeFn => self.word_nbsp("unsafe"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn print_onceness(&mut self, o: ast::Onceness) -> IoResult<()> {
|
|
||||||
match o {
|
|
||||||
ast::Once => self.word_nbsp("once"),
|
|
||||||
ast::Many => Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
|
||||||
// file at the top-level directory of this distribution and at
|
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
||||||
// option. This file may not be copied, modified, or distributed
|
|
||||||
// except according to those terms.
|
|
||||||
|
|
||||||
// Testing guarantees provided by once functions.
|
|
||||||
// This program would segfault if it were legal.
|
|
||||||
|
|
||||||
#![feature(once_fns)]
|
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
fn foo(blk: once ||) {
|
|
||||||
blk();
|
|
||||||
blk(); //~ ERROR use of moved value
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let x = Arc::new(true);
|
|
||||||
foo(|| {
|
|
||||||
assert!(*x);
|
|
||||||
drop(x);
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
|
||||||
// file at the top-level directory of this distribution and at
|
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
||||||
// option. This file may not be copied, modified, or distributed
|
|
||||||
// except according to those terms.
|
|
||||||
|
|
||||||
// Testing guarantees provided by once functions.
|
|
||||||
// This program would segfault if it were legal.
|
|
||||||
|
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
fn foo(blk: ||) {
|
|
||||||
blk();
|
|
||||||
blk();
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let x = Arc::new(true);
|
|
||||||
foo(|| {
|
|
||||||
assert!(*x);
|
|
||||||
drop(x); //~ ERROR cannot move out of captured outer variable
|
|
||||||
})
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
|
|
||||||
// file at the top-level directory of this distribution and at
|
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
||||||
// option. This file may not be copied, modified, or distributed
|
|
||||||
// except according to those terms.
|
|
||||||
|
|
||||||
#![feature(once_fns)]
|
|
||||||
fn main() {
|
|
||||||
let f: once || = ||();
|
|
||||||
let g: || = f; //~ ERROR mismatched types
|
|
||||||
let h: || = ||();
|
|
||||||
let i: once || = h; // ok
|
|
||||||
}
|
|
|
@ -11,7 +11,6 @@
|
||||||
// Testing guarantees provided by once functions.
|
// Testing guarantees provided by once functions.
|
||||||
|
|
||||||
|
|
||||||
#![feature(once_fns)]
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
fn foo(blk: proc()) {
|
fn foo(blk: proc()) {
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
|
||||||
// file at the top-level directory of this distribution and at
|
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
||||||
// option. This file may not be copied, modified, or distributed
|
|
||||||
// except according to those terms.
|
|
||||||
|
|
||||||
// Testing guarantees provided by once functions.
|
|
||||||
|
|
||||||
|
|
||||||
#![feature(once_fns)]
|
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
fn foo(blk: once ||) {
|
|
||||||
blk();
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
let x = Arc::new(true);
|
|
||||||
foo(|| {
|
|
||||||
assert!(*x);
|
|
||||||
drop(x);
|
|
||||||
})
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue