Skip to content

Commit 041a612

Browse files
author
Gabriel Smith
committed
resolve: Allow idents to resolve to primitives in the type namespace
1 parent a0d40f8 commit 041a612

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustc_resolve/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,6 +1726,14 @@ impl<'a> Resolver<'a> {
17261726
}
17271727
}
17281728

1729+
if ns == TypeNS {
1730+
if let Some(prim_ty) = self.primitive_type_table.primitive_types.get(&ident.name) {
1731+
let binding = (Res::PrimTy(*prim_ty), ty::Visibility::Public,
1732+
DUMMY_SP, ExpnId::root()).to_name_binding(self.arenas);
1733+
return Some(LexicalScopeBinding::Item(binding));
1734+
}
1735+
}
1736+
17291737
None
17301738
}
17311739

0 commit comments

Comments
 (0)