-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Tool for checking the safety of non-exhaustive patterns #2896
Comments
(Of course, we might just get rid of |
Nominating for milestone: far future. |
accepted for far future |
Triage bump. |
Visiting for triage. |
I think we should close this ticket at this point; the language has changed quite a bit since it was written so that it is hard for an average community member to actually know what it is really asking for. (I suppose now that we have the ability to put attributes on match arms, it would be feasible to annotate match arms, where the attribute would indicate whether we want the hypothetical tool to warn about whether they are actually reachable. But still, I think we should close this; tools like this can be added in the future, but it need not be a task that the rust team undertakes, and it does not require changes to the language nor core tools.) |
@pnkfelix Agreed. Regardless of how feasible a Rust version of Check is, it seems out of scope of the compiler. Could this be closed? |
cargo-miri: fix forwarding arguments to cargo Fixes rust-lang/miri#2829
Next Kani release.
This is definitely in the department of blue-sky, out-there projects, but I was just thinking about
option::get
and wondering how feasible it would be to adapt the ideas in Neil Mitchell's Catch tool (for Haskell) to Rust.http://community.haskell.org/~ndm/catch/
In our case, this would be to verify that
alt check
, and maybe even functions that pattern-match on their input and unconditionally fail in one or more branches (likeoption::get
) are being used safely (which is to say, in a way that won't cause a runtime failure). This would be one way to allowalt check
s and get a safety guarantee.Mutability would definitely complicate things, but one way out is to only provide any guarantees about immutable data (and warn in a lint pass about
alt check
and similar things on mutable data).The text was updated successfully, but these errors were encountered: