Skip to content

Commit b0bf0f8

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 171831 b: refs/heads/beta c: 58b0d74 h: refs/heads/master i: 171829: cbbc820 171827: a2b8e5c 171823: d4b3062 v: v3
1 parent c591c0f commit b0bf0f8

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b5571ed71a5879c0495a982506258d5d267744ed
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 865aabb6622c44ab47c616c244642a85ce0c4719
34+
refs/heads/beta: 58b0d7479fb478d9c8293e78adaa86a8971442d5
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub enum ObsoleteSyntax {
3434
ObsoleteExternCrateRenaming,
3535
ObsoleteProcType,
3636
ObsoleteProcExpr,
37+
ObsoleteClosureType,
3738
}
3839

3940
pub trait ParserObsoleteMethods {
@@ -94,6 +95,10 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> {
9495
ObsoleteExternCrateRenaming => (
9596
"`extern crate foo = bar` syntax",
9697
"write `extern crate bar as foo` instead"
98+
),
99+
ObsoleteClosureType => (
100+
"`|uint| -> bool` closure type syntax",
101+
"use unboxed closures instead, no type annotation needed"
97102
)
98103
};
99104

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

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,32 +1227,29 @@ impl<'a> Parser<'a> {
12271227
12281228
*/
12291229

1230-
let unsafety = self.parse_unsafety();
1230+
let ty_closure_span = self.last_span;
12311231

1232-
let lifetime_defs = self.parse_legacy_lifetime_defs(lifetime_defs);
1232+
// To be helpful, parse the closure type as ever
1233+
let _ = self.parse_unsafety();
12331234

1234-
let inputs = if self.eat(&token::OrOr) {
1235-
Vec::new()
1236-
} else {
1235+
let _ = self.parse_legacy_lifetime_defs(lifetime_defs);
1236+
1237+
if !self.eat(&token::OrOr) {
12371238
self.expect_or();
12381239

1239-
let inputs = self.parse_seq_to_before_or(
1240+
let _ = self.parse_seq_to_before_or(
12401241
&token::Comma,
12411242
|p| p.parse_arg_general(false));
12421243
self.expect_or();
1243-
inputs
1244-
};
1244+
}
12451245

1246-
let bounds = self.parse_colon_then_ty_param_bounds(BoundParsingMode::Bare);
1246+
let _ = self.parse_colon_then_ty_param_bounds(BoundParsingMode::Bare);
12471247

1248-
let output = self.parse_ret_ty();
1249-
let decl = P(FnDecl {
1250-
inputs: inputs,
1251-
output: output,
1252-
variadic: false
1253-
});
1248+
let _ = self.parse_ret_ty();
12541249

1255-
panic!("stub");
1250+
self.obsolete(ty_closure_span, ObsoleteClosureType);
1251+
1252+
TyInfer
12561253
}
12571254

12581255
pub fn parse_unsafety(&mut self) -> Unsafety {

0 commit comments

Comments
 (0)