🍺 BREW Explorer

← all formulae

cargo-careful

brew install cargo-careful v0.4.10 Apache-2.0 OR MIT

Execute Rust code carefully, with extra checking along the way

21
30-day installs · #6702
60
90-day · #6842
189
365-day · #7496
490
★ GitHub stars · updated 4mo ago

Build dependencies

Links

Raw metadata
{
  "aliases": [],
  "alternatives": [],
  "build_dependencies": [
    "rust"
  ],
  "categories": [],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "Execute Rust code carefully, with extra checking along the way",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:36:07+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "cargo-careful",
  "github_default_branch": "master",
  "github_last_commit_at": "2026-04-01T08:00:23Z",
  "github_readme_excerpt": "# cargo-careful\n\n`cargo careful` is a tool to run your Rust code extra carefully -- opting into a bunch of\nnightly-only extra checks that help detect Undefined Behavior, and using a standard library with\ndebug assertions.\nThe standard library does check for some Undefined Behavior when the program is built\nwith debug assertions, but some of these checks are disabled because their performance\nimpact was considered too high.\nFor example, it will find the alignment issue in the following snippet:\n\n```rust\nfn main() {\n    let arr = [1u8, 2, 3, 4];\n    for n in [0, 1] {\n        let val = unsafe { arr.as_ptr().add(n).cast::\u003cu16\u003e().read() };\n        println!(\"The value is {val}!\");\n    }\n}\n```\n\nTo use `cargo careful`, first install it:\n\n```\ncargo install cargo-careful\n```\n\nand then run the following in your project:\n\n```\ncargo +nightly careful test\n```\n\nYou can also `cargo +nightly careful run` to execute a binary crate. All `cargo test` and `cargo\nrun` flags are supported.\n\nRunning `cargo careful` requires a recent nightly toolchain. Nightly versions from the last 3 months\nare supported.\n\nThe first time you run `cargo careful`, it needs to run some setup steps, which requires the\n`rustc-src` rustup component -- the tool will offer to install it for you if needed.\n\n## What does it do?\n\n### Detect Undefined Behavior\n\nThe most important thing `cargo careful` does is that it builds the standard library with debug\nassertions.\nThe standard library does check for some Undefined Behavior when the program is built\nwith debug assertions, but some of these checks are disabled because their performance\nimpact was considered too high.\nFurthermore, `cargo careful` sets some flags that tell rustc to insert extra run-time checks.\n\nHere are some of the checks this enables:\n\n- `ptr.read()`/`ptr.write(v)` check that the pointer is aligned and non-null.\n- The collection types perform plenty of internal consistency checks.\n- `mem::zeroed` and the deprecated `mem::uninitialized` panic if the t",
  "github_repo": "RalfJung/cargo-careful",
  "github_stars": 490,
  "github_topics": [],
  "homepage": "https://github.com/RalfJung/cargo-careful",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 21,
  "installs_365d": 189,
  "installs_90d": 60,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "Apache-2.0 OR MIT",
  "llm_generated_at": null,
  "llm_model": null,
  "name": "cargo-careful",
  "oldnames": [],
  "one_liner": null,
  "optional_dependencies": [],
  "rank_30d": 6702,
  "rank_365d": 7496,
  "rank_90d": 6842,
  "raw_hash": "299be283a156ed2c",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/c/cargo-careful.rb",
  "tap": "homebrew/core",
  "test_dependencies": [
    "rustup"
  ],
  "uses_from_macos": [],
  "version_head": "HEAD",
  "version_stable": "0.4.10",
  "versioned_formulae": [],
  "why_use_this": null
}