We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd2f1cb commit 01d7f87Copy full SHA for 01d7f87
compiler/rustc_typeck/src/collect.rs
@@ -1369,7 +1369,11 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
1369
generics.parent_count + generics.params.len()
1370
});
1371
1372
- let mut params: Vec<_> = opt_self.into_iter().collect();
+ let mut params: Vec<_> = Vec::with_capacity(ast_generics.params.len() + has_self as usize);
1373
+
1374
+ if let Some(opt_self) = opt_self {
1375
+ params.push(opt_self);
1376
+ }
1377
1378
let early_lifetimes = early_bound_lifetimes_from_generics(tcx, ast_generics);
1379
params.extend(early_lifetimes.enumerate().map(|(i, param)| ty::GenericParamDef {
0 commit comments