Do not look for significant drop inside .await expansion (#13985)
Temporaries created inside the expansion of `.await` will be dropped and need no checking. Looking inside the expansion will trigger false positives. changelog: [`significant_drop_in_scrutinee`]: do not falsely warn for temporaries created by `.await` expansion Fix #13927
This commit is contained in:
commit
8c1ea9fa01
3 changed files with 38 additions and 3 deletions
|
|
@ -441,8 +441,9 @@ impl<'tcx> Visitor<'tcx> for SigDropHelper<'_, 'tcx> {
|
|||
let parent_expr_before = self.parent_expr.replace(ex);
|
||||
|
||||
match ex.kind {
|
||||
// Skip blocks because values in blocks will be dropped as usual.
|
||||
ExprKind::Block(..) => (),
|
||||
// Skip blocks because values in blocks will be dropped as usual, and await
|
||||
// desugaring because temporary insides the future will have been dropped.
|
||||
ExprKind::Block(..) | ExprKind::Match(_, _, MatchSource::AwaitDesugar) => (),
|
||||
_ => walk_expr(self, ex),
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue