X-Git-Url: https://git.ralfj.de/web.git/blobdiff_plain/ca9d874b3fe170ea9cf70fb3ff319b9a00ab5763..bc620a95ca16dbe33d32a462eb8cc06414c0ba3d:/ralf/_posts/2022-09-26-cargo-careful.md diff --git a/ralf/_posts/2022-09-26-cargo-careful.md b/ralf/_posts/2022-09-26-cargo-careful.md index 36381ef..234b8d4 100644 --- a/ralf/_posts/2022-09-26-cargo-careful.md +++ b/ralf/_posts/2022-09-26-cargo-careful.md @@ -1,6 +1,7 @@ --- title: "cargo careful: run your Rust code with extra careful debug checking" categories: rust +reddit: /rust/comments/xogayv/cargo_careful_run_your_rust_code_with_extra/ --- Did you know that the standard library is full of useful checks that users never get to see? @@ -11,7 +12,7 @@ However, the regular standard library that is distributed by rustup is compiled [`cargo careful`](https://github.com/RalfJung/cargo-careful) is here to close this gap: when invoked the first time, it builds a standard library with debug assertions from source, and then runs your program or test suite with that standard library. -Installing `cargo careful` is as easy as `cargo install cargo-careful`, and then you can do `cargo careful run`/`cargo careful test` to execute your binary crates and test suites with an extra amount of debug checking. +Installing `cargo careful` is as easy as `cargo install cargo-careful`, and then you can do `cargo +nightly careful run`/`cargo +nightly careful test` to execute your binary crates and test suites with an extra amount of debug checking. This will naturally be slower than a regular debug or release build, but it is *much* faster than executing your program in [Miri](https://github.com/rust-lang/miri) and still helps find some Undefined Behavior. Unlike Miri, it is fully FFI-compatible (though the code behind the FFI barrier is completely unchecked). @@ -22,3 +23,5 @@ There are probably ways to improve this in the future. Meanwhile, if you have some `unsafe` code that for one reason or another you cannot test with Miri, give [`cargo careful`] a try and let me know how it is doing. :) [`cargo careful`]: https://github.com/RalfJung/cargo-careful + +*By the way, I am soon [starting as a professor at ETH Zürich]({% post_url 2022-08-16-eth %}), so if you are interested in working with me on programming language theory as a master student, PhD student, or post-doc, then please [reach out](https://research.ralfj.de/contact.html)!*