Skip to content

Commit 5cc8fd9

Browse files
committed
---
yaml --- r: 93757 b: refs/heads/try c: f977bed h: refs/heads/master i: 93755: 8bae14c v: v3
1 parent dff544b commit 5cc8fd9

File tree

6 files changed

+14
-20
lines changed

6 files changed

+14
-20
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: ba739b2135f794dd2f1cff3c82cf9282cc1d50cb
5+
refs/heads/try: f977bedafd657b52fb618cc788cc31f35336270d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libsyntax/parse/obsolete.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ pub enum ObsoleteSyntax {
4141
ObsoleteLoopAsContinue,
4242
ObsoleteEnumWildcard,
4343
ObsoleteStructWildcard,
44-
ObsoleteVecDotDotWildcard
44+
ObsoleteVecDotDotWildcard,
45+
ObsoleteBoxedClosure,
4546
}
4647

4748
impl to_bytes::IterBytes for ObsoleteSyntax {
@@ -128,6 +129,11 @@ impl ParserObsoleteMethods for Parser {
128129
"vec slice wildcard",
129130
"use `..` instead of `.._` for matching slices"
130131
),
132+
ObsoleteBoxedClosure => (
133+
"managed or owned closure",
134+
"managed closures have been removed and owned closures are \
135+
now written `proc()`"
136+
),
131137
};
132138

133139
self.report(sp, kind, kind_str, desc);

branches/try/src/libsyntax/parse/parser.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,15 +1273,17 @@ impl Parser {
12731273
pub fn parse_box_or_uniq_pointee(&self,
12741274
sigil: ast::Sigil,
12751275
ctor: &fn(v: mt) -> ty_) -> ty_ {
1276-
// ~'foo fn() or ~fn() are parsed directly as fn types:
1276+
// ~'foo fn() or ~fn() are parsed directly as obsolete fn types:
12771277
match *self.token {
12781278
token::LIFETIME(*) => {
12791279
let lifetime = self.parse_lifetime();
1280+
self.obsolete(*self.last_span, ObsoleteBoxedClosure);
12801281
return self.parse_ty_closure(Some(sigil), Some(lifetime));
12811282
}
12821283

1283-
token::IDENT(*) => {
1284+
token::IDENT(*) if sigil == ast::BorrowedSigil => {
12841285
if self.token_is_old_style_closure_keyword() {
1286+
self.obsolete(*self.last_span, ObsoleteBoxedClosure);
12851287
return self.parse_ty_closure(Some(sigil), None);
12861288
}
12871289
}

branches/try/src/test/compile-fail/issue-8615.rs

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

branches/try/src/test/compile-fail/once-cant-call-twice-on-heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ extern mod extra;
1616
use extra::arc;
1717
use std::util;
1818

19-
fn foo(blk: ~once fn()) {
19+
fn foo(blk: proc()) {
2020
blk();
2121
blk(); //~ ERROR use of moved value
2222
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extern mod extra;
1717
use extra::arc;
1818
use std::util;
1919

20-
fn foo(blk: ~once fn()) {
20+
fn foo(blk: proc()) {
2121
blk();
2222
}
2323

0 commit comments

Comments
 (0)