about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-03-16 03:34:32 +0100
committerGitHub <noreply@github.com>2022-03-16 03:34:32 +0100
commit2bd5c44e9395d2ea185d58f651097cd9d0b43afc (patch)
tree01a975efb3ca53fbc221774d7cfc952d23e8c960 /compiler/rustc_codegen_llvm/src
parentf986c7434ae958567721dfcff336c51cc2bf663d (diff)
parent0f4c81a1a9c6c45a2b45c336dd77b3bb9fdfc62e (diff)
downloadrust-2bd5c44e9395d2ea185d58f651097cd9d0b43afc.tar.gz
rust-2bd5c44e9395d2ea185d58f651097cd9d0b43afc.zip
Rollup merge of #94951 - est31:irrefutable_let_chain_patterns, r=estebank
Extend the irrefutable_let_patterns lint to let chains

Implements the suggestion from https://github.com/rust-lang/rust/pull/94927#issuecomment-1067078300

We only look for complete suffixes or prefixes of irrefutable let patterns, so
that an irrefutable let pattern in a chain surrounded by refutable ones is
not linted, as it is an useful pattern that has no low-cost replacement (unlike suffixes or prefixes which can just be copied outside of the `if`: either into the `if`'s block, or the block surrounding the `if`).
If all patterns in a let chain are irrefutable, we lint as well.

Depends on #94958 ~~so I included it into the PR for now~~ *which has been merged since*.

r? `@estebank`

cc `@joshtriplett` `@c410-f3r`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions