Skip to content

Commit 5ac6935

Browse files
committed
Move pick_by_value_method docs above function header
- Currently style triggers #81183 so we can't add `#[instrument]` to this function. - Having docs above the header is more consistent with the rest of the code base.
1 parent fe1bf8e commit 5ac6935

File tree

1 file changed

+6
-8
lines changed
  • compiler/rustc_typeck/src/check/method

1 file changed

+6
-8
lines changed

compiler/rustc_typeck/src/check/method/probe.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -1090,19 +1090,17 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
10901090
.next()
10911091
}
10921092

1093+
/// For each type `T` in the step list, this attempts to find a method where
1094+
/// the (transformed) self type is exactly `T`. We do however do one
1095+
/// transformation on the adjustment: if we are passing a region pointer in,
1096+
/// we will potentially *reborrow* it to a shorter lifetime. This allows us
1097+
/// to transparently pass `&mut` pointers, in particular, without consuming
1098+
/// them for their entire lifetime.
10931099
fn pick_by_value_method(
10941100
&mut self,
10951101
step: &CandidateStep<'tcx>,
10961102
self_ty: Ty<'tcx>,
10971103
) -> Option<PickResult<'tcx>> {
1098-
//! For each type `T` in the step list, this attempts to find a
1099-
//! method where the (transformed) self type is exactly `T`. We
1100-
//! do however do one transformation on the adjustment: if we
1101-
//! are passing a region pointer in, we will potentially
1102-
//! *reborrow* it to a shorter lifetime. This allows us to
1103-
//! transparently pass `&mut` pointers, in particular, without
1104-
//! consuming them for their entire lifetime.
1105-
11061104
if step.unsize {
11071105
return None;
11081106
}

0 commit comments

Comments
 (0)