From ba8d6d1e4ea2590b31470171efc175b0301c5e1c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 2 Nov 2020 16:31:38 +0100 Subject: Remove more unreachable pubs --- crates/hir_ty/src/infer.rs | 2 +- crates/hir_ty/src/infer/unify.rs | 2 +- crates/hir_ty/src/traits/chalk.rs | 2 +- crates/hir_ty/src/traits/chalk/interner.rs | 30 +++++++++++++++--------------- crates/hir_ty/src/traits/chalk/mapping.rs | 6 +++--- 5 files changed, 21 insertions(+), 21 deletions(-) (limited to 'crates/hir_ty/src') diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs index f4c1fa2f2..a14d67c06 100644 --- a/crates/hir_ty/src/infer.rs +++ b/crates/hir_ty/src/infer.rs @@ -94,7 +94,7 @@ enum BindingMode { } impl BindingMode { - pub fn convert(annotation: BindingAnnotation) -> BindingMode { + fn convert(annotation: BindingAnnotation) -> BindingMode { match annotation { BindingAnnotation::Unannotated | BindingAnnotation::Mutable => BindingMode::Move, BindingAnnotation::Ref => BindingMode::Ref(Mutability::Shared), diff --git a/crates/hir_ty/src/infer/unify.rs b/crates/hir_ty/src/infer/unify.rs index 2406a7361..76984242e 100644 --- a/crates/hir_ty/src/infer/unify.rs +++ b/crates/hir_ty/src/infer/unify.rs @@ -35,7 +35,7 @@ where #[derive(Debug)] pub(super) struct Canonicalized { - pub value: Canonical, + pub(super) value: Canonical, free_vars: Vec, } diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index a6c247f87..55e2c3a3e 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs @@ -27,7 +27,7 @@ use mapping::{ TypeAliasAsValue, }; -pub use self::interner::*; +pub(crate) use self::interner::*; pub(super) mod tls; mod interner; diff --git a/crates/hir_ty/src/traits/chalk/interner.rs b/crates/hir_ty/src/traits/chalk/interner.rs index f65873872..39569e690 100644 --- a/crates/hir_ty/src/traits/chalk/interner.rs +++ b/crates/hir_ty/src/traits/chalk/interner.rs @@ -10,21 +10,21 @@ use std::{fmt, sync::Arc}; #[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] pub struct Interner; -pub type AssocTypeId = chalk_ir::AssocTypeId; -pub type AssociatedTyDatum = chalk_solve::rust_ir::AssociatedTyDatum; -pub type ForeignDefId = chalk_ir::ForeignDefId; -pub type TraitId = chalk_ir::TraitId; -pub type TraitDatum = chalk_solve::rust_ir::TraitDatum; -pub type AdtId = chalk_ir::AdtId; -pub type StructDatum = chalk_solve::rust_ir::AdtDatum; -pub type ImplId = chalk_ir::ImplId; -pub type ImplDatum = chalk_solve::rust_ir::ImplDatum; -pub type AssociatedTyValueId = chalk_solve::rust_ir::AssociatedTyValueId; -pub type AssociatedTyValue = chalk_solve::rust_ir::AssociatedTyValue; -pub type FnDefId = chalk_ir::FnDefId; -pub type FnDefDatum = chalk_solve::rust_ir::FnDefDatum; -pub type OpaqueTyId = chalk_ir::OpaqueTyId; -pub type OpaqueTyDatum = chalk_solve::rust_ir::OpaqueTyDatum; +pub(crate) type AssocTypeId = chalk_ir::AssocTypeId; +pub(crate) type AssociatedTyDatum = chalk_solve::rust_ir::AssociatedTyDatum; +pub(crate) type ForeignDefId = chalk_ir::ForeignDefId; +pub(crate) type TraitId = chalk_ir::TraitId; +pub(crate) type TraitDatum = chalk_solve::rust_ir::TraitDatum; +pub(crate) type AdtId = chalk_ir::AdtId; +pub(crate) type StructDatum = chalk_solve::rust_ir::AdtDatum; +pub(crate) type ImplId = chalk_ir::ImplId; +pub(crate) type ImplDatum = chalk_solve::rust_ir::ImplDatum; +pub(crate) type AssociatedTyValueId = chalk_solve::rust_ir::AssociatedTyValueId; +pub(crate) type AssociatedTyValue = chalk_solve::rust_ir::AssociatedTyValue; +pub(crate) type FnDefId = chalk_ir::FnDefId; +pub(crate) type FnDefDatum = chalk_solve::rust_ir::FnDefDatum; +pub(crate) type OpaqueTyId = chalk_ir::OpaqueTyId; +pub(crate) type OpaqueTyDatum = chalk_solve::rust_ir::OpaqueTyDatum; impl chalk_ir::interner::Interner for Interner { type InternedType = Arc>; diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs index 58c337b40..86cbc4c7e 100644 --- a/crates/hir_ty/src/traits/chalk/mapping.rs +++ b/crates/hir_ty/src/traits/chalk/mapping.rs @@ -464,7 +464,7 @@ impl ToChalk for CallableDefId { } } -pub struct TypeAliasAsAssocType(pub TypeAliasId); +pub(crate) struct TypeAliasAsAssocType(pub(crate) TypeAliasId); impl ToChalk for TypeAliasAsAssocType { type Chalk = AssocTypeId; @@ -478,7 +478,7 @@ impl ToChalk for TypeAliasAsAssocType { } } -pub struct TypeAliasAsForeignType(pub TypeAliasId); +pub(crate) struct TypeAliasAsForeignType(pub(crate) TypeAliasId); impl ToChalk for TypeAliasAsForeignType { type Chalk = ForeignDefId; @@ -492,7 +492,7 @@ impl ToChalk for TypeAliasAsForeignType { } } -pub struct TypeAliasAsValue(pub TypeAliasId); +pub(crate) struct TypeAliasAsValue(pub(crate) TypeAliasId); impl ToChalk for TypeAliasAsValue { type Chalk = AssociatedTyValueId; -- cgit v1.2.3