File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -148,12 +148,21 @@ and parse_auto_slot_and_init
148
148
let stmts = ctxt " slot, ident and init: init" (parse_init lval) ps in
149
149
(stmts, slot_auto, ident)
150
150
151
+
152
+ and parse_stmts (ps :pstate ) : Ast.stmt array =
153
+ let arr = parse_stmts_including_none ps in
154
+ if (Array. length arr) == 0 then
155
+ raise (err " statement does nothing" ps);
156
+ arr
157
+
158
+
159
+
151
160
(*
152
161
* We have no way to parse a single Ast.stmt; any incoming syntactic statement
153
162
* may desugar to N>1 real Ast.stmts
154
163
*)
155
164
156
- and parse_stmts (ps :pstate ) : Ast.stmt array =
165
+ and parse_stmts_including_none (ps :pstate ) : Ast.stmt array =
157
166
let apos = lexpos ps in
158
167
159
168
let ensure_mutable slot =
Original file line number Diff line number Diff line change
1
+ // error-pattern: does nothing
2
+ fn main ( ) {
3
+ log "doing" ;
4
+ this_does_nothing_what_the;
5
+ log "boing" ;
6
+ }
7
+
You can’t perform that action at this time.
0 commit comments