Skip to content

Commit

Permalink
Move pick_by_value_method docs above function header
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
osa1 committed Feb 24, 2021
1 parent fe1bf8e commit 5ac6935
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions compiler/rustc_typeck/src/check/method/probe.rs
Expand Up @@ -1090,19 +1090,17 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
.next()
}

/// For each type `T` in the step list, this attempts to find a method where
/// the (transformed) self type is exactly `T`. We do however do one
/// transformation on the adjustment: if we are passing a region pointer in,
/// we will potentially *reborrow* it to a shorter lifetime. This allows us
/// to transparently pass `&mut` pointers, in particular, without consuming
/// them for their entire lifetime.
fn pick_by_value_method(
&mut self,
step: &CandidateStep<'tcx>,
self_ty: Ty<'tcx>,
) -> Option<PickResult<'tcx>> {
//! For each type `T` in the step list, this attempts to find a
//! method where the (transformed) self type is exactly `T`. We
//! do however do one transformation on the adjustment: if we
//! are passing a region pointer in, we will potentially
//! *reborrow* it to a shorter lifetime. This allows us to
//! transparently pass `&mut` pointers, in particular, without
//! consuming them for their entire lifetime.

if step.unsize {
return None;
}
Expand Down

0 comments on commit 5ac6935

Please sign in to comment.