-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Description
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 (like option::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 allow alt 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).
Activity
catamorphism commentedon Jul 13, 2012
(Of course, we might just get rid of
alt check
... but we'll always haveoption::get
, probably. This certainly isn't necessary, but in case someone who likes static analysis wanted to pick it up for fun...)pnkfelix commentedon Jun 21, 2013
Nominating for milestone: far future.
pnkfelix commentedon Jun 27, 2013
accepted for far future
thestinger commentedon Aug 19, 2013
Triage bump.
emberian commentedon Jan 14, 2014
Visiting for triage.
alt check
is now known amatch
.pnkfelix commentedon May 7, 2014
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.)
ghost commentedon Jul 11, 2014
@pnkfelix Agreed. Regardless of how feasible a Rust version of Check is, it seems out of scope of the compiler. Could this be closed?
Auto merge of rust-lang#2896 - RalfJung:cargo-miri-args, r=RalfJung
Bump Kani version to 0.42.0 (rust-lang#2896)