-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Do not trigger unused_{braces,parens}
lints with yield
#75031
Conversation
The duplicate errors on while are actually part of a bigger problem, the following should not warn: fn main() {
let mut a = Some(3);
while let Some(ref mut v) = {a} {
a.as_mut().map(|a| std::mem::swap(a, v));
}
} The way to fix this would be to pretty much copy what we are already doing for If you want to fix that as part of this PR, feel free, otherwise r=me @bors delegate+ |
✌️ @JohnTitor can now approve this pull request |
1 similar comment
✌️ @JohnTitor can now approve this pull request |
Ah, interesting! I didn't realize this case, yeah, we should fix then.
I'm going to r=you as-is since I think the fix is out of context of @bors r=lcnr |
📌 Commit 2e7ba78 has been approved by |
…arth Rollup of 5 pull requests Successful merges: - rust-lang#74980 (pprust: adjust mixed comment printing and add regression test for rust-lang#74745) - rust-lang#75009 (Document the discrepancy in the mask type for _mm_shuffle_ps) - rust-lang#75031 (Do not trigger `unused_{braces,parens}` lints with `yield`) - rust-lang#75059 (fix typos) - rust-lang#75064 (compiletest: Support ignoring tests requiring missing LLVM components) Failed merges: r? @ghost
…r=lcnr Do not trigger `unused_braces` for `while let` Follow-up for rust-lang#75031 r? @lcnr
…r=lcnr Do not trigger `unused_braces` for `while let` Follow-up for rust-lang#75031 r? @lcnr
…r=lcnr Do not trigger `unused_braces` for `while let` Follow-up for rust-lang#75031 r? @lcnr
…r=lcnr Do not trigger `unused_braces` for `while let` Follow-up for rust-lang#75031 r? @lcnr
…r=lcnr Do not trigger `unused_braces` for `while let` Follow-up for rust-lang#75031 r? @lcnr
Fixes #74883
r? @lcnr