Commit e9dac80
gccrs: Prevent warning on "unreachable" items
Items declared in a block expression can't be unreachable.
gcc/rust/ChangeLog:
* hir/rust-ast-lower.cc (ASTLoweringBlock::visit): Check if a
statement is an item before warning.
gcc/testsuite/ChangeLog:
* rust/compile/unreachable.rs: New test.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>1 parent 38fc892 commit e9dac80
2 files changed
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments