Ignore significant drops of place expressions

This commit is contained in:
Ruihan Li 2024-04-29 12:55:12 +08:00
parent a78a15c5d3
commit 509ca90bf1
3 changed files with 74 additions and 2 deletions

View file

@ -116,7 +116,7 @@ impl<'a, 'tcx> SigDropChecker<'a, 'tcx> {
}
fn is_sig_drop_expr(&mut self, ex: &'tcx Expr<'_>) -> bool {
self.has_sig_drop_attr(self.cx.typeck_results().expr_ty(ex))
!ex.is_syntactic_place_expr() && self.has_sig_drop_attr(self.cx.typeck_results().expr_ty(ex))
}
fn has_sig_drop_attr(&mut self, ty: Ty<'tcx>) -> bool {