diff options
| author | Aman Arora <arora-aman@users.noreply.github.com> | 2021-07-09 13:45:26 -0400 |
|---|---|---|
| committer | Aman Arora <me@aman-arora.com> | 2021-07-09 15:12:24 -0400 |
| commit | 5055569008fda3ea8424b2b01824d44fca42d830 (patch) | |
| tree | 034331a7da32e7814593d2fd781d000bf044597d | |
| parent | 28921b4213d1f0c0e5eacf2b69146ca7e5f2c22b (diff) | |
| download | rust-5055569008fda3ea8424b2b01824d44fca42d830.tar.gz rust-5055569008fda3ea8424b2b01824d44fca42d830.zip | |
Apply suggestions from code review
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
| -rw-r--r-- | compiler/rustc_typeck/src/check/upvar.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_typeck/src/check/upvar.rs b/compiler/rustc_typeck/src/check/upvar.rs index 6a086370713..e0f0215a58c 100644 --- a/compiler/rustc_typeck/src/check/upvar.rs +++ b/compiler/rustc_typeck/src/check/upvar.rs @@ -306,7 +306,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { .collect() } - /// Adjusts the closure capture information to ensure that the operations aren't unasfe, + /// Adjusts the closure capture information to ensure that the operations aren't unsafe, /// and that the path can be captured with required capture kind (depending on use in closure, /// move closure etc.) /// @@ -319,7 +319,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { /// for generators we don't even implement the closure traits /// really). /// - /// If we inferred that the closure needs to be FnMut/FnOnce, last element of the returned tuplle + /// If we inferred that the closure needs to be FnMut/FnOnce, last element of the returned tuple /// contains a `Some()` with the `Place` that caused us to do so. fn process_collected_capture_information( &self, @@ -331,7 +331,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let mut closure_kind = ty::ClosureKind::LATTICE_BOTTOM; let mut origin: Option<(Span, Place<'tcx>)> = None; - for (place, mut capture_info) in capture_information.into_iter() { + for (place, mut capture_info) in capture_information { // Apply rules for safety before inferring closure kind let place = restrict_capture_precision(place); @@ -1541,8 +1541,6 @@ impl<'a, 'tcx> InferBorrowKind<'a, 'tcx> { ty::ImmBorrow => false, }); - // let tcx = self.fcx.tcx; - // if this is an implicit deref of an // upvar, then we need to modify the // borrow_kind of the upvar to make sure it |
