diff options
| author | Ralf Jung <post@ralfj.de> | 2020-12-30 20:09:26 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-12-31 10:53:37 +0100 |
| commit | db03b58f23ba8b4b9ee89b2ce28588da6b5225c3 (patch) | |
| tree | 57cea70856623ad8ab31d05cc2d643e54dcd2742 /compiler/rustc_mir/src | |
| parent | 1862135351e87905e7a497bee96f199040ce1b51 (diff) | |
| download | rust-db03b58f23ba8b4b9ee89b2ce28588da6b5225c3.tar.gz rust-db03b58f23ba8b4b9ee89b2ce28588da6b5225c3.zip | |
remove move_val_init leftovers
Diffstat (limited to 'compiler/rustc_mir/src')
| -rw-r--r-- | compiler/rustc_mir/src/transform/check_unsafety.rs | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/compiler/rustc_mir/src/transform/check_unsafety.rs b/compiler/rustc_mir/src/transform/check_unsafety.rs index e64955c4986..0732d2568ad 100644 --- a/compiler/rustc_mir/src/transform/check_unsafety.rs +++ b/compiler/rustc_mir/src/transform/check_unsafety.rs @@ -223,13 +223,6 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> { // Check for raw pointer `Deref`. for (base, proj) in place.iter_projections() { if proj == ProjectionElem::Deref { - let source_info = self.source_info; // Backup source_info so we can restore it later. - if base.projection.is_empty() && decl.internal { - // Internal locals are used in the `move_val_init` desugaring. - // We want to check unsafety against the source info of the - // desugaring, rather than the source info of the RHS. - self.source_info = self.body.local_decls[place.local].source_info; - } let base_ty = base.ty(self.body, self.tcx).ty; if base_ty.is_unsafe_ptr() { self.require_unsafe( @@ -237,7 +230,6 @@ impl<'a, 'tcx> Visitor<'tcx> for UnsafetyChecker<'a, 'tcx> { UnsafetyViolationDetails::DerefOfRawPointer, ) } - self.source_info = source_info; // Restore backed-up source_info. } } |
