File tree Expand file tree Collapse file tree 3 files changed +19
-17
lines changed
branches/beta/src/libsyntax/parse Expand file tree Collapse file tree 3 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -31,5 +31,5 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
31
31
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32
32
refs/heads/batch: b5571ed71a5879c0495a982506258d5d267744ed
33
33
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34
- refs/heads/beta: 865aabb6622c44ab47c616c244642a85ce0c4719
34
+ refs/heads/beta: 58b0d7479fb478d9c8293e78adaa86a8971442d5
35
35
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ pub enum ObsoleteSyntax {
34
34
ObsoleteExternCrateRenaming ,
35
35
ObsoleteProcType ,
36
36
ObsoleteProcExpr ,
37
+ ObsoleteClosureType ,
37
38
}
38
39
39
40
pub trait ParserObsoleteMethods {
@@ -94,6 +95,10 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> {
94
95
ObsoleteExternCrateRenaming => (
95
96
"`extern crate foo = bar` syntax" ,
96
97
"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"
97
102
)
98
103
} ;
99
104
Original file line number Diff line number Diff line change @@ -1227,32 +1227,29 @@ impl<'a> Parser<'a> {
1227
1227
1228
1228
*/
1229
1229
1230
- let unsafety = self . parse_unsafety ( ) ;
1230
+ let ty_closure_span = self . last_span ;
1231
1231
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 ( ) ;
1233
1234
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 ) {
1237
1238
self . expect_or ( ) ;
1238
1239
1239
- let inputs = self . parse_seq_to_before_or (
1240
+ let _ = self . parse_seq_to_before_or (
1240
1241
& token:: Comma ,
1241
1242
|p| p. parse_arg_general ( false ) ) ;
1242
1243
self . expect_or ( ) ;
1243
- inputs
1244
- } ;
1244
+ }
1245
1245
1246
- let bounds = self . parse_colon_then_ty_param_bounds ( BoundParsingMode :: Bare ) ;
1246
+ let _ = self . parse_colon_then_ty_param_bounds ( BoundParsingMode :: Bare ) ;
1247
1247
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 ( ) ;
1254
1249
1255
- panic ! ( "stub" ) ;
1250
+ self . obsolete ( ty_closure_span, ObsoleteClosureType ) ;
1251
+
1252
+ TyInfer
1256
1253
}
1257
1254
1258
1255
pub fn parse_unsafety ( & mut self ) -> Unsafety {
You can’t perform that action at this time.
0 commit comments