Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shadow_unrelated in Xilem Core #745

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

DJMcNab
Copy link
Member

@DJMcNab DJMcNab commented Nov 12, 2024

Note, this fix is only excluding the false positives as a result of: rust-lang/rust-clippy#10780

When/if the fix for that (rust-lang/rust-clippy#13677) trickles onto stable, we can remove the expects.

Note, this fix is only excluding the false positives as a result of:
rust-lang/rust-clippy#10780

When/if the fix for that trickles onto stable, we can remove the expects
@DJMcNab DJMcNab added this pull request to the merge queue Nov 12, 2024
Merged via the queue into linebender:main with commit 6af1949 Nov 12, 2024
17 checks passed
@DJMcNab DJMcNab deleted the shadow_unrelated branch November 12, 2024 18:00
github-merge-queue bot pushed a commit to rust-lang/rust-clippy that referenced this pull request Nov 30, 2024
Fixes #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 linebender/xilem#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants