Skip to content

Commit 1edda11

Browse files
authored
Unrolled build for rust-lang#134400
Rollup merge of rust-lang#134400 - spastorino:fix-some-comments, r=compiler-errors Fix some comments related to upvars handling I'm tidying up my ergonomic ref counting PR and I'm going to make some small, simple and unrelated changes outside that PR, so the main PR sticks more straight to the point.
2 parents 604d669 + 93d599c commit 1edda11

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

compiler/rustc_hir_typeck/src/upvar.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//! to everything owned by `x`, so the result is the same for something
1515
//! like `x.f = 5` and so on (presuming `x` is not a borrowed pointer to a
1616
//! struct). These adjustments are performed in
17-
//! `adjust_upvar_borrow_kind()` (you can trace backwards through the code
17+
//! `adjust_for_non_move_closure` (you can trace backwards through the code
1818
//! from there).
1919
//!
2020
//! The fact that we are inferring borrow kinds as we go results in a
@@ -1684,8 +1684,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
16841684
// want to capture by ref to allow precise capture using reborrows.
16851685
//
16861686
// If the data will be moved out of this place, then the place will be truncated
1687-
// at the first Deref in `adjust_upvar_borrow_kind_for_consume` and then moved into
1688-
// the closure.
1687+
// at the first Deref in `adjust_for_move_closure` and then moved into the closure.
16891688
hir::CaptureBy::Value { .. } if !place.deref_tys().any(Ty::is_ref) => {
16901689
ty::UpvarCapture::ByValue
16911690
}

compiler/rustc_mir_build/src/thir/cx/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ impl<'tcx> Cx<'tcx> {
11971197
.temporary_scope(self.region_scope_tree, closure_expr.hir_id.local_id);
11981198
let var_ty = place.base_ty;
11991199

1200-
// The result of capture analysis in `rustc_hir_analysis/check/upvar.rs`represents a captured path
1200+
// The result of capture analysis in `rustc_hir_typeck/src/upvar.rs` represents a captured path
12011201
// as it's seen for use within the closure and not at the time of closure creation.
12021202
//
12031203
// That is we see expect to see it start from a captured upvar and not something that is local

0 commit comments

Comments
 (0)