Skip to content
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

Handle nested items correctly in typestate_check #334

Closed
wants to merge 2 commits into from

Conversation

catamorphism
Copy link
Contributor

Summary says it all. Actually, only nested objects and functions
are handled, but that's better than before. The fold that I was using
before to traverse a crate wasn't working correctly, because annotations
have to reflect the number of local variables of the nearest enclosing
function (in turn, because annotations are represented as bit vectors).
The fold was traversing the AST in the wrong order, first filling in
the annotations correctly, but then re-traversing them with the bit
vector length for any outer nested functions, and so on.

Remedying this required writing a lot of tedious boilerplate code
because I scrapped the idea of using a fold altogether.

I also made typestate_check handle unary, field, alt, and fail.

Also, some miscellaneous changes:

  • added annotations to blocks in typeck
  • fix pprust so it can handle spawn
  • added more logging functions in util.common
  • fixed _vec.or
  • added maybe and from_maybe in option
  • removed fold_block field from ast_fold, since it was never used

Summary says it all. Actually, only nested objects and functions
are handled, but that's better than before. The fold that I was using
before to traverse a crate wasn't working correctly, because annotations
have to reflect the number of local variables of the nearest enclosing
function (in turn, because annotations are represented as bit vectors).
The fold was traversing the AST in the wrong order, first filling in
the annotations correctly, but then re-traversing them with the bit
vector length for any outer nested functions, and so on.

Remedying this required writing a lot of tedious boilerplate code
because I scrapped the idea of using a fold altogether.

I also made typestate_check handle unary, field, alt, and fail.

Also, some miscellaneous changes:
* added annotations to blocks in typeck
* fix pprust so it can handle spawn
* added more logging functions in util.common
* fixed _vec.or
* added maybe and from_maybe in option
* removed fold_block field from ast_fold, since it was never used
@graydon graydon closed this Apr 19, 2011
@graydon
Copy link
Contributor

graydon commented Apr 19, 2011

Integrated. Thanks!

oli-obk added a commit to oli-obk/rust that referenced this pull request Sep 19, 2017
Windows support in the test suite + appveyor
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this pull request Dec 12, 2017
Cast unsigned literals to signed integers.
kazcw pushed a commit to kazcw/rust that referenced this pull request Oct 23, 2018
The public API isn't changing in this commit but the internal organization is
being rejiggered. Instead of `x86/$subtarget/$feature.rs` the folders are
changed to `coresimd/x86/$feature.rs` and `coresimd/x86_64/$feature.rs`. The
`arch::x86_64` then reexports both the contents of the `x86` module and the
`x86_64` module.
dlrobertson pushed a commit to dlrobertson/rust that referenced this pull request Nov 29, 2018
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Oct 26, 2020
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this pull request Mar 7, 2023
celinval pushed a commit to celinval/rust-dev that referenced this pull request Jun 4, 2024
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.

2 participants