Skip to content

Handle nested items correctly in typestate_check #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/comp/middle/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,6 @@ type ast_fold[ENV] =
(fn(&ENV e, ann a) -> ann) fold_ann,

// Additional nodes.
(fn(&ENV e, &span sp,
&ast.block_) -> block) fold_block,

(fn(&ENV e, &fn_decl decl,
ast.proto proto,
Expand Down Expand Up @@ -1718,7 +1716,6 @@ fn new_identity_fold[ENV]() -> ast_fold[ENV] {

fold_ann = bind identity_fold_ann[ENV](_,_),

fold_block = bind identity_fold_block[ENV](_,_,_),
fold_fn = bind identity_fold_fn[ENV](_,_,_,_),
fold_fn_decl = bind identity_fold_fn_decl[ENV](_,_,_,_),
fold_mod = bind identity_fold_mod[ENV](_,_),
Expand Down
3 changes: 2 additions & 1 deletion src/comp/middle/typeck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,8 @@ mod Pushdown {
}
case (none[@ast.expr]) {
Demand.simple(fcx, bloc.span, expected, plain_ty(ty.ty_nil));
ret bloc;
ret fold.respan[ast.block_](bloc.span,
rec(a = boring_ann() with bloc.node));
}
}
}
Expand Down
Loading