diff options
| author | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-02-11 10:41:28 -0800 |
|---|---|---|
| committer | Dylan MacKenzie <ecstaticmorse@gmail.com> | 2020-02-19 10:51:40 -0800 |
| commit | 3bb7da2e4fa54519069fd110cf665cdf0407f58d (patch) | |
| tree | 99cdec1179023d91cadff2e27353bf6deb2e6c66 /src/librustc | |
| parent | ea3c9d27cffceb9d4c8dcfda1c96b138d7f01f3d (diff) | |
Replace `rustc_typeck::Namespace` with `rustc_hir::def::Namespace`
Diffstat (limited to 'src/librustc')
| -rw-r--r-- | src/librustc/ty/mod.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index a4b4e1d6574..c70a296e34b 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -33,7 +33,7 @@ use rustc_data_structures::fx::FxIndexMap; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; use rustc_data_structures::sync::{self, par_iter, Lrc, ParallelIterator}; use rustc_hir as hir; -use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res}; +use rustc_hir::def::{CtorKind, CtorOf, DefKind, Namespace, Res}; use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE}; use rustc_hir::{Constness, GlobMap, Node, TraitMap}; use rustc_index::vec::{Idx, IndexVec}; @@ -216,6 +216,13 @@ impl AssocKind { ty::AssocKind::Const => "associated constant", } } + + pub fn namespace(&self) -> Namespace { + match *self { + ty::AssocKind::OpaqueTy | ty::AssocKind::Type => Namespace::TypeNS, + ty::AssocKind::Const | ty::AssocKind::Method => Namespace::ValueNS, + } + } } impl AssocItem { |
