diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-11-07 15:48:55 -0500 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2014-11-07 15:51:30 -0500 |
| commit | 091dc6e98a483c164735e9a0b9c5b3750a94a95f (patch) | |
| tree | 79db3c0e120fbe1e02f710d2a7f2a881d83098c0 /src/libsyntax | |
| parent | 3112771001e0e7e9b068ba0bb0ca45c3e8f0f72a (diff) | |
| download | rust-091dc6e98a483c164735e9a0b9c5b3750a94a95f.tar.gz rust-091dc6e98a483c164735e9a0b9c5b3750a94a95f.zip | |
Purge the old `once_fns`, which are not coming back
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 59 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 9 |
3 files changed, 33 insertions, 45 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 80b158a54d3..c38fea9b3d5 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -38,7 +38,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[ ("globs", Active), ("macro_rules", Active), ("struct_variant", Active), - ("once_fns", Active), ("asm", Active), ("managed_boxes", Removed), ("non_ascii_idents", Active), @@ -307,11 +306,10 @@ impl<'a, 'v> Visitor<'v> for Context<'a> { fn visit_ty(&mut self, t: &ast::Ty) { match t.node { - ast::TyClosure(ref closure) if closure.onceness == ast::Once => { - self.gate_feature("once_fns", t.span, - "once functions are \ - experimental and likely to be removed"); - + ast::TyClosure(ref closure) => { + // this used to be blocked by a feature gate, but it should just + // be plain impossible right now + assert!(closure.onceness != ast::Once); }, _ => {} } diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index b0cca5e14de..f501a5831d2 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -503,42 +503,41 @@ declare_special_idents_and_keywords! { (27, Mod, "mod"); (28, Move, "move"); (29, Mut, "mut"); - (30, Once, "once"); - (31, Pub, "pub"); - (32, Ref, "ref"); - (33, Return, "return"); + (30, Pub, "pub"); + (31, Ref, "ref"); + (32, Return, "return"); // Static and Self are also special idents (prefill de-dupes) (super::STATIC_KEYWORD_NAME_NUM, Static, "static"); (super::SELF_KEYWORD_NAME_NUM, Self, "self"); - (34, Struct, "struct"); + (33, Struct, "struct"); (super::SUPER_KEYWORD_NAME_NUM, Super, "super"); - (35, True, "true"); - (36, Trait, "trait"); - (37, Type, "type"); - (38, Unsafe, "unsafe"); - (39, Use, "use"); - (40, Virtual, "virtual"); - (41, While, "while"); - (42, Continue, "continue"); - (43, Proc, "proc"); - (44, Box, "box"); - (45, Const, "const"); - (46, Where, "where"); + (34, True, "true"); + (35, Trait, "trait"); + (36, Type, "type"); + (37, Unsafe, "unsafe"); + (38, Use, "use"); + (39, Virtual, "virtual"); + (40, While, "while"); + (41, Continue, "continue"); + (42, Proc, "proc"); + (43, Box, "box"); + (44, Const, "const"); + (45, Where, "where"); 'reserved: - (47, Alignof, "alignof"); - (48, Be, "be"); - (49, Offsetof, "offsetof"); - (50, Priv, "priv"); - (51, Pure, "pure"); - (52, Sizeof, "sizeof"); - (53, Typeof, "typeof"); - (54, Unsized, "unsized"); - (55, Yield, "yield"); - (56, Do, "do"); - (57, Abstract, "abstract"); - (58, Final, "final"); - (59, Override, "override"); + (46, Alignof, "alignof"); + (47, Be, "be"); + (48, Offsetof, "offsetof"); + (49, Priv, "priv"); + (50, Pure, "pure"); + (51, Sizeof, "sizeof"); + (52, Typeof, "typeof"); + (53, Unsized, "unsized"); + (54, Yield, "yield"); + (55, Do, "do"); + (56, Abstract, "abstract"); + (57, Final, "final"); + (58, Override, "override"); } } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 5b57a875c4a..c1515a36bec 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2663,12 +2663,10 @@ impl<'a> State<'a> { } else if opt_sigil == Some('&') { try!(self.print_fn_style(fn_style)); try!(self.print_extern_opt_abi(opt_abi)); - try!(self.print_onceness(onceness)); } else { assert!(opt_sigil.is_none()); try!(self.print_fn_style(fn_style)); try!(self.print_opt_abi_and_extern_if_nondefault(opt_abi)); - try!(self.print_onceness(onceness)); try!(word(&mut self.s, "fn")); } @@ -2987,13 +2985,6 @@ impl<'a> State<'a> { 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)] |
