-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Typestate 2 #380
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
Typestate 2 #380
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…, so I added one (though this wasn't causing the problem I was seeing...
… annotations * Reorganized typestate into several modules. * Made typestate check that any function with a non-nil return type returns a value. For now, the check is a warning and not an error (see next item). * Added a "bot" type (prettyprinted as _|_), for constructs like be, ret, break, cont, and fail that don't locally return a value that can be inspected. "bot" is distinct from "nil". There is no concrete syntax for _|_, while the concrete syntax for the nil type is (). * Added support to the parser for a ! annotation on functions whose result type is _|_. Such a function is required to have either a fail or a call to another ! function that is reached in all control flow paths. The point of this annotation is to mark functions like unimpl() and span_err(), so that an alt with a call to err() in one case isn't a false positive for the return-value checker. I haven't actually annotated anything with it yet. * Random bugfixes: * * Fixed bug in trans::trans_binary that was throwing away the cleanups for nested subexpressions of an and or or (tests: box-inside-if and box-inside-if2). ** In typeck, unify the expected type arguments of a tag with the actual specified arguments.
…tterns with their expected tag types
get_os and get_arch were failing to return a value in the error case; they were also assuming that strings are indexed from 1. No idea how they ever worked, but anyway, fixed.
I think this will require a new stage1 snapshot (there's code in the "Started adding support for return checking..." patch that triggers bugs in stage0). The procedure scares me, though. |
Integrated. Thanks. |
kazcw
pushed a commit
to kazcw/rust
that referenced
this pull request
Oct 23, 2018
dlrobertson
pushed a commit
to dlrobertson/rust
that referenced
this pull request
Nov 29, 2018
Add impl trait and remove others from undocumented list
dlrobertson
pushed a commit
to dlrobertson/rust
that referenced
this pull request
Nov 29, 2018
Sorry, missed one in my last commit. Also, rust-lang#380 recently removed the link, but not the actual entry.
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
* handle insertvalue array * add tests * fix test
calebzulawski
added a commit
to calebzulawski/rust
that referenced
this pull request
Feb 17, 2024
Fix bitmask vector bit order
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apologies in advance for having lots of changes in a big commit. I've spent so much time on git yak-shaving the past week that I don't want to mess with it anymore =P