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.
This commit is contained in:
parent
fe1bf8e05c
commit
5ac6935974
1 changed files with 6 additions and 8 deletions
|
@ -1090,19 +1090,17 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
|
||||||
.next()
|
.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(
|
fn pick_by_value_method(
|
||||||
&mut self,
|
&mut self,
|
||||||
step: &CandidateStep<'tcx>,
|
step: &CandidateStep<'tcx>,
|
||||||
self_ty: Ty<'tcx>,
|
self_ty: Ty<'tcx>,
|
||||||
) -> Option<PickResult<'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 {
|
if step.unsize {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue