diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2024-12-17 05:37:19 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-17 05:37:19 -0500 |
| commit | 0956be6aa50c291c1e5c72dee8fa02d211208e06 (patch) | |
| tree | c77f02499c8ad1f0393796e0ce3b6493aad765c5 | |
| parent | 3e93f2b5d9f31aa473d15c73eb287cd24fc87f14 (diff) | |
| parent | 93d599cb6295501641635c6551051178c948a34f (diff) | |
| download | rust-0956be6aa50c291c1e5c72dee8fa02d211208e06.tar.gz rust-0956be6aa50c291c1e5c72dee8fa02d211208e06.zip | |
Rollup merge of #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.
| -rw-r--r-- | compiler/rustc_hir_typeck/src/upvar.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_mir_build/src/thir/cx/expr.rs | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_hir_typeck/src/upvar.rs b/compiler/rustc_hir_typeck/src/upvar.rs index 4f283644cbe..b3085843141 100644 --- a/compiler/rustc_hir_typeck/src/upvar.rs +++ b/compiler/rustc_hir_typeck/src/upvar.rs @@ -14,7 +14,7 @@ //! to everything owned by `x`, so the result is the same for something //! like `x.f = 5` and so on (presuming `x` is not a borrowed pointer to a //! struct). These adjustments are performed in -//! `adjust_upvar_borrow_kind()` (you can trace backwards through the code +//! `adjust_for_non_move_closure` (you can trace backwards through the code //! from there). //! //! The fact that we are inferring borrow kinds as we go results in a @@ -1684,8 +1684,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // want to capture by ref to allow precise capture using reborrows. // // If the data will be moved out of this place, then the place will be truncated - // at the first Deref in `adjust_upvar_borrow_kind_for_consume` and then moved into - // the closure. + // at the first Deref in `adjust_for_move_closure` and then moved into the closure. hir::CaptureBy::Value { .. } if !place.deref_tys().any(Ty::is_ref) => { ty::UpvarCapture::ByValue } diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index 65a91d003af..ae49b266153 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -1197,7 +1197,7 @@ impl<'tcx> Cx<'tcx> { .temporary_scope(self.region_scope_tree, closure_expr.hir_id.local_id); let var_ty = place.base_ty; - // The result of capture analysis in `rustc_hir_analysis/check/upvar.rs`represents a captured path + // The result of capture analysis in `rustc_hir_typeck/src/upvar.rs` represents a captured path // as it's seen for use within the closure and not at the time of closure creation. // // That is we see expect to see it start from a captured upvar and not something that is local |
