Fix unchecked.

Do not duplicate data size checking.
This commit is contained in:
Stephen Chung
2021-06-12 10:26:50 +08:00
parent f9dcfeb1ad
commit 68ea8c27fd
6 changed files with 80 additions and 88 deletions

View File

@@ -297,7 +297,7 @@ fn optimize_stmt_block(
Stmt::Noop(*pos)
};
}
[.., second_last_stmt, Stmt::Noop(_)] if second_last_stmt.returns_value() => {}
[.., second_last_stmt, Stmt::Noop(_)] if second_last_stmt.returns_value() => (),
[.., second_last_stmt, last_stmt]
if !last_stmt.returns_value() && is_pure(last_stmt) =>
{