Skip to content

Commit 5055569

Browse files
Apply suggestions from code review
Co-authored-by: Niko Matsakis <[email protected]>
1 parent 28921b4 commit 5055569

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

compiler/rustc_typeck/src/check/upvar.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
306306
.collect()
307307
}
308308

309-
/// Adjusts the closure capture information to ensure that the operations aren't unasfe,
309+
/// Adjusts the closure capture information to ensure that the operations aren't unsafe,
310310
/// and that the path can be captured with required capture kind (depending on use in closure,
311311
/// move closure etc.)
312312
///
@@ -319,7 +319,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
319319
/// for generators we don't even implement the closure traits
320320
/// really).
321321
///
322-
/// If we inferred that the closure needs to be FnMut/FnOnce, last element of the returned tuplle
322+
/// If we inferred that the closure needs to be FnMut/FnOnce, last element of the returned tuple
323323
/// contains a `Some()` with the `Place` that caused us to do so.
324324
fn process_collected_capture_information(
325325
&self,
@@ -331,7 +331,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
331331
let mut closure_kind = ty::ClosureKind::LATTICE_BOTTOM;
332332
let mut origin: Option<(Span, Place<'tcx>)> = None;
333333

334-
for (place, mut capture_info) in capture_information.into_iter() {
334+
for (place, mut capture_info) in capture_information {
335335
// Apply rules for safety before inferring closure kind
336336
let place = restrict_capture_precision(place);
337337

@@ -1541,8 +1541,6 @@ impl<'a, 'tcx> InferBorrowKind<'a, 'tcx> {
15411541
ty::ImmBorrow => false,
15421542
});
15431543

1544-
// let tcx = self.fcx.tcx;
1545-
15461544
// if this is an implicit deref of an
15471545
// upvar, then we need to modify the
15481546
// borrow_kind of the upvar to make sure it

0 commit comments

Comments
 (0)