diff options
| author | Jason Newcomb <jsnewcomb@pm.me> | 2024-11-30 17:08:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-30 17:08:08 +0000 |
| commit | 650e0c8d3deeffc38cb7ca3f1eb4c7ac42b46d48 (patch) | |
| tree | c66c06301cf2640567ccc198a47cbc43b70adf0e /compiler/rustc_llvm/llvm-wrapper/Linker.cpp | |
| parent | af1f78af05af5ff7dd2d8b31386f96ce9bfc7a8a (diff) | |
| parent | d1cab0860a3b8d28f84a96661a1c6177a5e3fbba (diff) | |
| download | rust-650e0c8d3deeffc38cb7ca3f1eb4c7ac42b46d48.tar.gz rust-650e0c8d3deeffc38cb7ca3f1eb4c7ac42b46d48.zip | |
Fix `shadow_unrelated`'s behaviour with closures (#13677)
Fixes https://github.com/rust-lang/rust-clippy/issues/10780 We correctly no longer give a warning when a closure is passed to a method, where one of the arguments to that method uses the variable which would be shadowed by an argument to that closure. Uses is defined loosely as any expression used in the calling expression mentions the shadowee binding (except for the closure itself): ```rust #![deny(clippy::shadow_unrelated)] let x = Some(1); let y = x.map(|x| x + 1); ``` will now succeed. See https://github.com/linebender/xilem/pull/745 - without this change, all of the `expect(shadow_unrelated)` in the repository are met; with it, none of them are. changelog: [`shadow_unrelated`]: Don't treat closures arguments as unrelated when the calling function uses them
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/Linker.cpp')
0 files changed, 0 insertions, 0 deletions
