X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_typeck%2Fnamespace.rs;h=2aa97aa7e6f0bf02fe1bb5462b3d9b049d72dae2;hb=75a977dd478b249a7d29bc4ed3efed8df85b1ddc;hp=1e1d3e7865c92cba748b9dbde85ff3bc2f30a813;hpb=5421d94960018235654c7fb39aa1c502a3564621;p=rust.git diff --git a/src/librustc_typeck/namespace.rs b/src/librustc_typeck/namespace.rs index 1e1d3e7865c..2aa97aa7e6f 100644 --- a/src/librustc_typeck/namespace.rs +++ b/src/librustc_typeck/namespace.rs @@ -1,5 +1,5 @@ -use rustc::hir; use rustc::ty; +use rustc_hir as hir; // Whether an item exists in the type or value namespace. #[derive(Copy, Clone, PartialEq, Eq, Debug)] @@ -11,21 +11,17 @@ pub enum Namespace { impl From for Namespace { fn from(a_kind: ty::AssocKind) -> Self { match a_kind { - ty::AssocKind::OpaqueTy | - ty::AssocKind::Type => Namespace::Type, - ty::AssocKind::Const | - ty::AssocKind::Method => Namespace::Value, + ty::AssocKind::OpaqueTy | ty::AssocKind::Type => Namespace::Type, + ty::AssocKind::Const | ty::AssocKind::Method => Namespace::Value, } } } -impl<'a> From <&'a hir::ImplItemKind> for Namespace { - fn from(impl_kind: &'a hir::ImplItemKind) -> Self { +impl<'a> From<&'a hir::ImplItemKind<'_>> for Namespace { + fn from(impl_kind: &'a hir::ImplItemKind<'_>) -> Self { match *impl_kind { - hir::ImplItemKind::OpaqueTy(..) | - hir::ImplItemKind::TyAlias(..) => Namespace::Type, - hir::ImplItemKind::Const(..) | - hir::ImplItemKind::Method(..) => Namespace::Value, + hir::ImplItemKind::OpaqueTy(..) | hir::ImplItemKind::TyAlias(..) => Namespace::Type, + hir::ImplItemKind::Const(..) | hir::ImplItemKind::Method(..) => Namespace::Value, } } }