File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
tests/ui/pattern/rfc-3637-guard-patterns Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1+ //@ check-pass
2+ //! Regression test for issue #146445.
3+ //!
4+ //! This test ensures that liveness linting works correctly with guard patterns
5+ //! and doesn't cause an ICE ("no successor") when using variables without
6+ //! underscore prefixes in guard expressions.
7+ //!
8+ //! Fixed by #142390 which moved liveness analysis to MIR.
9+
10+ #![ feature( guard_patterns) ]
11+ #![ expect( incomplete_features) ]
12+
13+ fn main ( ) {
14+ // This used to ICE before liveness analysis was moved to MIR.
15+ // The variable `main` (without underscore prefix) would trigger
16+ // liveness linting which wasn't properly implemented for guard patterns.
17+ match ( 0 , ) {
18+ ( _ if { let main = false ; main } , ) => { }
19+ _ => { }
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments