Do not look for significant drop inside .await expansion
Temporaries created inside the expansion of `.await` will be dropped and need no checking. Looking inside the expansion will trigger false positives.
This commit is contained in:
parent
ab55d3fc62
commit
0b402baf15
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