1
Fork 0

Rollup merge of #77066 - jonas-schievink:dest-prop-borrow, r=oli-obk

Fix dest prop miscompilation around references

Closes https://github.com/rust-lang/rust/issues/77002
This commit is contained in:
Jonas Schievink 2020-09-25 19:42:33 +02:00 committed by GitHub
commit 452aa759b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 205 additions and 179 deletions

View file

@ -905,7 +905,7 @@ impl<'a, 'tcx> Visitor<'tcx> for FindAssignments<'a, 'tcx> {
// FIXME: This can be smarter and take `StorageDead` into account (which
// invalidates borrows).
if self.ever_borrowed_locals.contains(dest.local)
&& self.ever_borrowed_locals.contains(src.local)
|| self.ever_borrowed_locals.contains(src.local)
{
return;
}