Properly handle reexport of foreign items.

Handles `pub use` of `extern { fn, static, type }`. Also plug in some more
`match` arms where handling `extern type` is reasonable.

Fixed #46098.
This commit is contained in:
kennytm 2017-11-21 00:22:19 +08:00
parent e06138338f
commit f0fcdbc021
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C
3 changed files with 79 additions and 0 deletions

View file

@ -2970,6 +2970,7 @@ fn register_def(cx: &DocContext, def: Def) -> DefId {
Def::Struct(i) => (i, TypeKind::Struct),
Def::Union(i) => (i, TypeKind::Union),
Def::Mod(i) => (i, TypeKind::Module),
Def::TyForeign(i) => (i, TypeKind::Foreign),
Def::Static(i, _) => (i, TypeKind::Static),
Def::Variant(i) => (cx.tcx.parent_def_id(i).unwrap(), TypeKind::Enum),
Def::SelfTy(Some(def_id), _) => (def_id, TypeKind::Trait),