Commit 593fb15
rust: Fix ICE in function_set_parameters
When lowering a function to HIR with a refutable pattern in its
parameter pattern, we were ICE'ing due to a lack of checks for invalid
refutable patterns. Fix this by erroring on invalid patterns while
lowering a function.
Fixes #3919
gcc/rust/ChangeLog:
* hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): added
refutable pattern checks for function params.
gcc/testsuite/ChangeLog:
* rust/compile/issue-3919-ice-func-parms.rs: New test.
Signed-off-by: Egas Ribeiro <egas.g.ribeiro@tecnico.ulisboa.pt>1 parent de7dffc commit 593fb15
2 files changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
458 | 477 | | |
459 | 478 | | |
460 | 479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments