@@ -160,21 +160,21 @@ pub struct Pick<'tcx> {
160
160
pub kind : PickKind < ' tcx > ,
161
161
pub import_ids : SmallVec < [ LocalDefId ; 1 ] > ,
162
162
163
- // Indicates that the source expression should be autoderef'd N times
164
- //
165
- // A = expr | *expr | **expr | ...
163
+ /// Indicates that the source expression should be autoderef'd N times
164
+ ///
165
+ /// A = expr | *expr | **expr | ...
166
166
pub autoderefs : usize ,
167
167
168
- // Indicates that an autoref is applied after the optional autoderefs
169
- //
170
- // B = A | &A | &mut A
168
+ /// Indicates that an autoref is applied after the optional autoderefs
169
+ ///
170
+ /// B = A | &A | &mut A
171
171
pub autoref : Option < hir:: Mutability > ,
172
172
173
- // Indicates that the source expression should be "unsized" to a
174
- // target type. This should probably eventually go away in favor
175
- // of just coercing method receivers.
176
- //
177
- // C = B | unsize(B)
173
+ /// Indicates that the source expression should be "unsized" to a
174
+ /// target type. This should probably eventually go away in favor
175
+ /// of just coercing method receivers.
176
+ ///
177
+ /// C = B | unsize(B)
178
178
pub unsize : Option < Ty < ' tcx > > ,
179
179
}
180
180
@@ -1091,19 +1091,17 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
1091
1091
. next ( )
1092
1092
}
1093
1093
1094
+ /// For each type `T` in the step list, this attempts to find a method where
1095
+ /// the (transformed) self type is exactly `T`. We do however do one
1096
+ /// transformation on the adjustment: if we are passing a region pointer in,
1097
+ /// we will potentially *reborrow* it to a shorter lifetime. This allows us
1098
+ /// to transparently pass `&mut` pointers, in particular, without consuming
1099
+ /// them for their entire lifetime.
1094
1100
fn pick_by_value_method (
1095
1101
& mut self ,
1096
1102
step : & CandidateStep < ' tcx > ,
1097
1103
self_ty : Ty < ' tcx > ,
1098
1104
) -> Option < PickResult < ' tcx > > {
1099
- //! For each type `T` in the step list, this attempts to find a
1100
- //! method where the (transformed) self type is exactly `T`. We
1101
- //! do however do one transformation on the adjustment: if we
1102
- //! are passing a region pointer in, we will potentially
1103
- //! *reborrow* it to a shorter lifetime. This allows us to
1104
- //! transparently pass `&mut` pointers, in particular, without
1105
- //! consuming them for their entire lifetime.
1106
-
1107
1105
if step. unsize {
1108
1106
return None ;
1109
1107
}
0 commit comments