Skip to content

Commit 949ba9c

Browse files
committed
rustboot: Parse, and ignore, "mutable?"
1 parent 2ef9c01 commit 949ba9c

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/boot/fe/pexp.ml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,14 @@ and parse_effect (ps:pstate) : Ast.effect =
159159

160160
and parse_mutability (ps:pstate) : Ast.mutability =
161161
match peek ps with
162-
MUTABLE -> bump ps; Ast.MUT_mutable
162+
MUTABLE ->
163+
begin
164+
(* HACK: ignore "mutable?" *)
165+
bump ps;
166+
match peek ps with
167+
QUES -> bump ps; Ast.MUT_immutable
168+
| _ -> Ast.MUT_mutable
169+
end
163170
| _ -> Ast.MUT_immutable
164171

165172
and parse_ty_fn
@@ -310,7 +317,12 @@ and parse_atomic_ty (ps:pstate) : Ast.ty =
310317

311318
| MUTABLE ->
312319
bump ps;
313-
Ast.TY_mutable (parse_ty ps)
320+
begin
321+
(* HACK: ignore "mutable?" *)
322+
match peek ps with
323+
QUES -> bump ps; parse_ty ps
324+
| _ -> Ast.TY_mutable (parse_ty ps)
325+
end
314326

315327
| LPAREN ->
316328
begin

0 commit comments

Comments
 (0)