File tree Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 0c913e63d926fc8cf1dd06260546b16f5aa90402
2
+ refs/heads/master: 5e1a6dac4409ba2f584fb41d0759e6c79ec8a8c4
Original file line number Diff line number Diff line change @@ -948,15 +948,13 @@ fn parse_bottom_expr(&parser p) -> @ast::expr {
948
948
hi = e. span. hi;
949
949
ex = ast:: expr_check( ast:: unchecked, e) ;
950
950
} else if ( eat_word( p, "ret") ) {
951
- alt ( p. peek( ) ) {
952
- case ( token:: SEMI ) { ex = ast:: expr_ret( none) ; }
953
- // Handle ret as the block result expression
954
- case ( token:: RBRACE ) { ex = ast:: expr_ret( none) ; }
955
- case ( _) {
956
- auto e = parse_expr( p) ;
957
- hi = e. span. hi;
958
- ex = ast:: expr_ret( some( e) ) ;
959
- }
951
+ if ( can_begin_expr( p. peek( ) ) ) {
952
+ auto e = parse_expr( p) ;
953
+ hi = e. span. hi;
954
+ ex = ast:: expr_ret( some( e) ) ;
955
+ }
956
+ else {
957
+ ex = ast:: expr_ret( none) ;
960
958
}
961
959
} else if ( eat_word( p, "break ") ) {
962
960
ex = ast:: expr_break;
Original file line number Diff line number Diff line change
1
+ // xfail-stage0
2
+ fn foo ( ) {
3
+ if ( ret) { }
4
+ }
5
+
6
+ fn main ( ) { foo ( ) ; }
You can’t perform that action at this time.
0 commit comments