Skip to content

Commit 091dc6e

Browse files
committed
Purge the old once_fns, which are not coming back
1 parent 3112771 commit 091dc6e

8 files changed

+33
-145
lines changed

src/libsyntax/feature_gate.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
3838
("globs", Active),
3939
("macro_rules", Active),
4040
("struct_variant", Active),
41-
("once_fns", Active),
4241
("asm", Active),
4342
("managed_boxes", Removed),
4443
("non_ascii_idents", Active),
@@ -307,11 +306,10 @@ impl<'a, 'v> Visitor<'v> for Context<'a> {
307306

308307
fn visit_ty(&mut self, t: &ast::Ty) {
309308
match t.node {
310-
ast::TyClosure(ref closure) if closure.onceness == ast::Once => {
311-
self.gate_feature("once_fns", t.span,
312-
"once functions are \
313-
experimental and likely to be removed");
314-
309+
ast::TyClosure(ref closure) => {
310+
// this used to be blocked by a feature gate, but it should just
311+
// be plain impossible right now
312+
assert!(closure.onceness != ast::Once);
315313
},
316314
_ => {}
317315
}

src/libsyntax/parse/token.rs

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -503,42 +503,41 @@ declare_special_idents_and_keywords! {
503503
(27, Mod, "mod");
504504
(28, Move, "move");
505505
(29, Mut, "mut");
506-
(30, Once, "once");
507-
(31, Pub, "pub");
508-
(32, Ref, "ref");
509-
(33, Return, "return");
506+
(30, Pub, "pub");
507+
(31, Ref, "ref");
508+
(32, Return, "return");
510509
// Static and Self are also special idents (prefill de-dupes)
511510
(super::STATIC_KEYWORD_NAME_NUM, Static, "static");
512511
(super::SELF_KEYWORD_NAME_NUM, Self, "self");
513-
(34, Struct, "struct");
512+
(33, Struct, "struct");
514513
(super::SUPER_KEYWORD_NAME_NUM, Super, "super");
515-
(35, True, "true");
516-
(36, Trait, "trait");
517-
(37, Type, "type");
518-
(38, Unsafe, "unsafe");
519-
(39, Use, "use");
520-
(40, Virtual, "virtual");
521-
(41, While, "while");
522-
(42, Continue, "continue");
523-
(43, Proc, "proc");
524-
(44, Box, "box");
525-
(45, Const, "const");
526-
(46, Where, "where");
514+
(34, True, "true");
515+
(35, Trait, "trait");
516+
(36, Type, "type");
517+
(37, Unsafe, "unsafe");
518+
(38, Use, "use");
519+
(39, Virtual, "virtual");
520+
(40, While, "while");
521+
(41, Continue, "continue");
522+
(42, Proc, "proc");
523+
(43, Box, "box");
524+
(44, Const, "const");
525+
(45, Where, "where");
527526

528527
'reserved:
529-
(47, Alignof, "alignof");
530-
(48, Be, "be");
531-
(49, Offsetof, "offsetof");
532-
(50, Priv, "priv");
533-
(51, Pure, "pure");
534-
(52, Sizeof, "sizeof");
535-
(53, Typeof, "typeof");
536-
(54, Unsized, "unsized");
537-
(55, Yield, "yield");
538-
(56, Do, "do");
539-
(57, Abstract, "abstract");
540-
(58, Final, "final");
541-
(59, Override, "override");
528+
(46, Alignof, "alignof");
529+
(47, Be, "be");
530+
(48, Offsetof, "offsetof");
531+
(49, Priv, "priv");
532+
(50, Pure, "pure");
533+
(51, Sizeof, "sizeof");
534+
(52, Typeof, "typeof");
535+
(53, Unsized, "unsized");
536+
(54, Yield, "yield");
537+
(55, Do, "do");
538+
(56, Abstract, "abstract");
539+
(57, Final, "final");
540+
(58, Override, "override");
542541
}
543542
}
544543

src/libsyntax/print/pprust.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2663,12 +2663,10 @@ impl<'a> State<'a> {
26632663
} else if opt_sigil == Some('&') {
26642664
try!(self.print_fn_style(fn_style));
26652665
try!(self.print_extern_opt_abi(opt_abi));
2666-
try!(self.print_onceness(onceness));
26672666
} else {
26682667
assert!(opt_sigil.is_none());
26692668
try!(self.print_fn_style(fn_style));
26702669
try!(self.print_opt_abi_and_extern_if_nondefault(opt_abi));
2671-
try!(self.print_onceness(onceness));
26722670
try!(word(&mut self.s, "fn"));
26732671
}
26742672

@@ -2987,13 +2985,6 @@ impl<'a> State<'a> {
29872985
ast::UnsafeFn => self.word_nbsp("unsafe"),
29882986
}
29892987
}
2990-
2991-
pub fn print_onceness(&mut self, o: ast::Onceness) -> IoResult<()> {
2992-
match o {
2993-
ast::Once => self.word_nbsp("once"),
2994-
ast::Many => Ok(())
2995-
}
2996-
}
29972988
}
29982989

29992990
#[cfg(test)]

src/test/compile-fail/once-cant-call-twice-on-stack.rs

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/test/compile-fail/once-cant-move-out-of-non-once-on-stack.rs

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/test/compile-fail/once-fn-subtyping.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/test/run-pass/once-move-out-on-heap.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
// Testing guarantees provided by once functions.
1212

1313

14-
#![feature(once_fns)]
1514
use std::sync::Arc;
1615

1716
fn foo(blk: proc()) {

src/test/run-pass/once-move-out-on-stack.rs

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)