// Inject a fake read of the newly created binding
// to test the fallout of fixing issue #53695 where NLL
- // allows to create variables that are immediately unusable.
+ // allows creating unused variables that are effectively unusable.
let source_info = self.source_info(irrefutable_pat.span);
self.cfg.push(
block,
},
);
+ // Inject a fake read of the newly created binding
+ // to test the fallout of fixing issue #53695 where NLL
+ // allows creating unused variables that are effectively unusable.
+ self.cfg.push(
+ block,
+ Statement {
+ source_info,
+ kind: StatementKind::ReadForMatch(place.clone()),
+ },
+ );
+
self.schedule_drop_for_binding(var, irrefutable_pat.span, OutsideGuard);
block.unit()
}