{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreihgqmcno7f2u354mdu2rxzkbi4kknt6nljgwwccefvtbefg34sehe",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mh7eciofrxk2"
  },
  "path": "/t/just-mut-alongside-let-mut/24084#post_9",
  "publishedAt": "2026-03-16T15:40:52.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "`clippy::shadow_unrelated`"
  ],
  "textContent": "I imagine many people rely on lints (e.g., `clippy::shadow_unrelated`) to detect or prevent shadowing, and I'd guess it wouldn't be that difficult to expand existing lints to detect such code or add new lints that would detect it.\n\nSuch lints already fire in the absence of `let` when dealing with function/closure parameters:\n\n\n    #[expect(clippy::shadow_unrelated, reason = \"example\")]\n    fn foo() -> u32 {\n        let x = 3u32;\n        x + Some(0u32)\n            .map(|mut x| {\n                x += 1;\n                x\n            })\n            .unwrap_or_default()\n    }\n",
  "title": "Just `mut` alongside `let mut`"
}