@@ -139,22 +139,22 @@ fn generic_arg_mismatch_err(
139
139
err. emit ( )
140
140
}
141
141
142
- /// Creates the relevant generic argument substitutions
142
+ /// Creates the relevant generic arguments
143
143
/// corresponding to a set of generic parameters. This is a
144
144
/// rather complex function. Let us try to explain the role
145
145
/// of each of its parameters:
146
146
///
147
- /// To start, we are given the `def_id` of the thing we are
148
- /// creating the substitutions for , and a partial set of
149
- /// substitutions `parent_args`. In general, the substitutions
150
- /// for an item begin with substitutions for all the "parents" of
147
+ /// To start, we are given the `def_id` of the thing whose generic
148
+ /// parameters we are instantiating , and a partial set of
149
+ /// arguments `parent_args`. In general, the generic arguments
150
+ /// for an item begin with arguments for all the "parents" of
151
151
/// that item -- e.g., for a method it might include the
152
152
/// parameters from the impl.
153
153
///
154
154
/// Therefore, the method begins by walking down these parents,
155
155
/// starting with the outermost parent and proceed inwards until
156
156
/// it reaches `def_id`. For each parent `P`, it will check `parent_args`
157
- /// first to see if the parent's substitutions are listed in there. If so,
157
+ /// first to see if the parent's arguments are listed in there. If so,
158
158
/// we can append those and move on. Otherwise, it invokes the
159
159
/// three callback functions:
160
160
///
@@ -188,15 +188,16 @@ pub fn create_args_for_parent_generic_args<'tcx, 'a>(
188
188
stack. push ( ( def_id, parent_defs) ) ;
189
189
}
190
190
191
- // We manually build up the substitution , rather than using convenience
191
+ // We manually build up the generic arguments , rather than using convenience
192
192
// methods in `subst.rs`, so that we can iterate over the arguments and
193
193
// parameters in lock-step linearly, instead of trying to match each pair.
194
194
let mut args: SmallVec < [ ty:: GenericArg < ' tcx > ; 8 ] > = SmallVec :: with_capacity ( count) ;
195
195
// Iterate over each segment of the path.
196
196
while let Some ( ( def_id, defs) ) = stack. pop ( ) {
197
197
let mut params = defs. params . iter ( ) . peekable ( ) ;
198
198
199
- // If we have already computed substitutions for parents, we can use those directly.
199
+ // If we have already computed the generic arguments for parents,
200
+ // we can use those directly.
200
201
while let Some ( & param) = params. peek ( ) {
201
202
if let Some ( & kind) = parent_args. get ( param. index as usize ) {
202
203
args. push ( kind) ;
0 commit comments