Skip to content

rustc: move the check_loop pass earlier. #13330

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

Merged
merged 1 commit into from
Apr 5, 2014
Merged

Conversation

huonw
Copy link
Member

@huonw huonw commented Apr 4, 2014

rustc: move the check_loop pass earlier.

This pass is purely AST based, and by running it earlier we emit more
useful error messages, e.g. type inference fails in the case of
let r = break; with few constraints on r, but it's more useful to be told that
the break is outside the loop (rather than a type error) when it is.

Closes #13292.

This pass is purely AST based, and by running it earlier we emit more
useful error messages, e.g. type inference fails in the case of `let r =
break;` with few constraints on `r`, but its more useful to be told that
the `break` is outside a loop (rather than a type error) when it is.

Closes rust-lang#13292.
bors added a commit that referenced this pull request Apr 5, 2014
rustc: move the check_loop pass earlier.

This pass is purely AST based, and by running it earlier we emit more
useful error messages, e.g. type inference fails in the case of 
`let r = break;` with few constraints on `r`, but it's more useful to be told that
the `break` is outside the loop (rather than a type error) when it is.

Closes #13292.
@bors bors closed this Apr 5, 2014
@bors bors merged commit 3766453 into rust-lang:master Apr 5, 2014
@huonw huonw deleted the loop-error branch June 27, 2014 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assigning break to a variable hits type checking errors even outside a loop
3 participants