about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-05-20 16:50:41 +0200
committerGitHub <noreply@github.com>2025-05-20 16:50:41 +0200
commitac500add80a545574344179c4c365730167f1ab2 (patch)
treea21500fb8f33ebc21c357b827690ecad6283823b /compiler/rustc_pattern_analysis/src/errors.rs
parent1f54e14cd5cdc39f8bdec5ef3a6d40ff83cd088a (diff)
parentc343b2a47c29bdfe4c611ba74f9c9e455f12539b (diff)
downloadrust-ac500add80a545574344179c4c365730167f1ab2.tar.gz
rust-ac500add80a545574344179c4c365730167f1ab2.zip
Rollup merge of #141275 - dianne:gather-guard-pat-locals-once, r=compiler-errors
`gather_locals`: only visit guard pattern guards when checking the guard

When checking a pattern with guards in it, `GatherLocalsVisitor` will visit both the pattern (when type-checking the let, arm, or param containing it) and local declarations in the guard expression (when checking the guard itself). This keeps it from visiting the guard when visiting the pattern, since otherwise it would gather locals from the guard twice, which would lead to a delayed bug: "evaluated expression more than once".

Tracking issue for guard patterns: #129967
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/errors.rs')
0 files changed, 0 insertions, 0 deletions