diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-25 15:10:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-25 15:10:08 +0000 |
commit | 041003da86f895ba5b00ae4a683996131d0441bf (patch) | |
tree | a51292d9a0d11909025d31a17b69771b498f7d1f /gcc/rust/backend | |
parent | de9af784e79926d01e8c030e999becc4b8bfad0f (diff) | |
parent | f48c7e87c5b9f7adbce961a0b081f59a5da999ab (diff) | |
download | gcc-041003da86f895ba5b00ae4a683996131d0441bf.zip gcc-041003da86f895ba5b00ae4a683996131d0441bf.tar.gz gcc-041003da86f895ba5b00ae4a683996131d0441bf.tar.bz2 |
Merge #387
387: Don't remove unreachable statements at HIR lowering r=philberty a=lrh2000
This is a legal code segment:
```rust
fn foo() -> i32 {
return 1;
let a = 1;
a
}
```
And this is illegal:
```rust
fn foo() -> i32 {
return 1;
let a = 1.5;
a
}
```
So we shouldn't remove unreachable statements at HIR lowering. We can issue warnings for them, but they need to be kept so that their types can be checked.
*(Original in https://github.com/Rust-GCC/gccrs/pull/364)*
Co-authored-by: lrh2000 <lrh2000@pku.edu.cn>
Diffstat (limited to 'gcc/rust/backend')
0 files changed, 0 insertions, 0 deletions