@@ -159,21 +159,21 @@ pub struct Pick<'tcx> {
159
159
pub kind : PickKind < ' tcx > ,
160
160
pub import_ids : SmallVec < [ LocalDefId ; 1 ] > ,
161
161
162
- // Indicates that the source expression should be autoderef'd N times
163
- //
164
- // A = expr | *expr | **expr | ...
162
+ /// Indicates that the source expression should be autoderef'd N times
163
+ ///
164
+ /// A = expr | *expr | **expr | ...
165
165
pub autoderefs : usize ,
166
166
167
- // Indicates that an autoref is applied after the optional autoderefs
168
- //
169
- // B = A | &A | &mut A
167
+ /// Indicates that an autoref is applied after the optional autoderefs
168
+ ///
169
+ /// B = A | &A | &mut A
170
170
pub autoref : Option < hir:: Mutability > ,
171
171
172
- // Indicates that the source expression should be "unsized" to a
173
- // target type. This should probably eventually go away in favor
174
- // of just coercing method receivers.
175
- //
176
- // C = B | unsize(B)
172
+ /// Indicates that the source expression should be "unsized" to a
173
+ /// target type. This should probably eventually go away in favor
174
+ /// of just coercing method receivers.
175
+ ///
176
+ /// C = B | unsize(B)
177
177
pub unsize : Option < Ty < ' tcx > > ,
178
178
}
179
179
@@ -1090,19 +1090,17 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
1090
1090
. next ( )
1091
1091
}
1092
1092
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.
1093
1099
fn pick_by_value_method (
1094
1100
& mut self ,
1095
1101
step : & CandidateStep < ' tcx > ,
1096
1102
self_ty : Ty < ' tcx > ,
1097
1103
) -> 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
-
1106
1104
if step. unsize {
1107
1105
return None ;
1108
1106
}
0 commit comments