Rollup merge of #114678 - MortenLohne:bugfix/hir-has-side-effects, r=compiler-errors
`Expr::can_have_side_effects()` is incorrect for struct/enum/array/tuple literals It would return 'false' unless *all* sub-expressions had side effects. This would easily allow side effects to slip through, and also wrongly label empty literals as having side effects. Add some tests for the last point The function is only used for simple lints and error messages, so not a serious bug.
Showing
tests/ui/return/return-struct.rs
0 → 100644
想要评论请 注册 或 登录