Skip to content

Commit 6d71cc6

Browse files
committed
Move std_path construction into condition
1 parent 66c2872 commit 6d71cc6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

compiler/rustc_resolve/src/late.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1891,12 +1891,11 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
18911891
self.r.trait_map.insert(id, traits);
18921892
}
18931893

1894-
let mut std_path = Vec::with_capacity(1 + path.len());
1895-
1896-
std_path.push(Segment::from_ident(Ident::with_dummy_span(sym::std)));
1897-
std_path.extend(path);
1898-
18991894
if self.r.primitive_type_table.primitive_types.contains_key(&path[0].ident.name) {
1895+
let mut std_path = Vec::with_capacity(1 + path.len());
1896+
1897+
std_path.push(Segment::from_ident(Ident::with_dummy_span(sym::std)));
1898+
std_path.extend(path);
19001899
if let PathResult::Module(_) | PathResult::NonModule(_) =
19011900
self.resolve_path(&std_path, Some(ns), false, span, CrateLint::No)
19021901
{

0 commit comments

Comments
 (0)