{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreidrbqeb6mjntpxdwflkqh4jswxprbkqjpt57wlufsgwnp7u4gxmhm",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mfmaogtijm42"
},
"path": "/t/custom-cargo-command-to-show-only-errors-avoid-setting-rustflags-every-time/24032#post_12",
"publishedAt": "2026-02-24T12:55:04.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "`RUSTFLAGS` (like most env variables) is a terrible interface for anything that you don't set once in your login script and then forget about it. _Sometimes_ it can be useful to set it once in your current session, but because it's entirely hidden state you're going to forget it and then be confused why, for example, one of your terminal windows gives different output than the one next to it. Anything you might want to ever change more often than that should be a command-line parameter and a per-profile setting in Cargo.toml so you can have separate \"devloop\" and \"_now_ I care about warnings\" profiles. Cargo is well known for having some idiosyncratic opinions as to what goes to Cargo.toml, what goes to .cargo/config.toml, what can be set on the command line, and what requires the use of `RUSTFLAGS`, that don't quite match many valid workflows that people have (I know there are efforts to alleviate some of these mismatches).",
"title": "Custom Cargo Command to Show Only Errors (Avoid Setting RustFLAGS Every Time)"
}