about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_resolve/src/late.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs
index 02a7bc0b622..4beaf6bfa80 100644
--- a/compiler/rustc_resolve/src/late.rs
+++ b/compiler/rustc_resolve/src/late.rs
@@ -1891,8 +1891,9 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
                     self.r.trait_map.insert(id, traits);
                 }
 
-                let mut std_path = vec![Segment::from_ident(Ident::with_dummy_span(sym::std))];
+                let mut std_path = Vec::with_capacity(1 + path.len());
 
+                std_path.push(Segment::from_ident(Ident::with_dummy_span(sym::std)));
                 std_path.extend(path);
 
                 if self.r.primitive_type_table.primitive_types.contains_key(&path[0].ident.name) {