From d7239e5ab4a3b88e9e79cc60d80eaf7300411e5a Mon Sep 17 00:00:00 2001 From: Dawer <7803845+iDawer@users.noreply.github.com> Date: Fri, 7 May 2021 12:20:23 +0500 Subject: Fix visibility warnings --- crates/hir_ty/src/diagnostics/pattern.rs | 18 +++++++++--------- crates/hir_ty/src/diagnostics/pattern/pat_util.rs | 4 ++-- crates/hir_ty/src/diagnostics/pattern/usefulness.rs | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'crates/hir_ty') diff --git a/crates/hir_ty/src/diagnostics/pattern.rs b/crates/hir_ty/src/diagnostics/pattern.rs index 99f32097f..9f65e38d6 100644 --- a/crates/hir_ty/src/diagnostics/pattern.rs +++ b/crates/hir_ty/src/diagnostics/pattern.rs @@ -4,7 +4,7 @@ mod deconstruct_pat; // TODO: find a better place for this? mod pat_util; -pub mod usefulness; +pub(crate) mod usefulness; use hir_def::{body::Body, EnumVariantId, LocalFieldId, VariantId}; use la_arena::Idx; @@ -13,7 +13,7 @@ use crate::{db::HirDatabase, AdtId, InferenceResult, Interner, Substitution, Ty, use self::pat_util::EnumerateAndAdjustIterator; -pub type PatId = Idx; +pub(crate) type PatId = Idx; #[derive(Clone, Debug)] pub(crate) enum PatternError { @@ -21,15 +21,15 @@ pub(crate) enum PatternError { } #[derive(Clone, Debug, PartialEq)] -pub struct FieldPat { - pub field: LocalFieldId, - pub pattern: Pat, +pub(crate) struct FieldPat { + pub(crate) field: LocalFieldId, + pub(crate) pattern: Pat, } #[derive(Clone, Debug, PartialEq)] -pub struct Pat { - pub ty: Ty, - pub kind: Box, +pub(crate) struct Pat { + pub(crate) ty: Ty, + pub(crate) kind: Box, } impl Pat { @@ -39,7 +39,7 @@ impl Pat { } #[derive(Clone, Debug, PartialEq)] -pub enum PatKind { +pub(crate) enum PatKind { Wild, /// `x`, `ref x`, `x @ P`, etc. diff --git a/crates/hir_ty/src/diagnostics/pattern/pat_util.rs b/crates/hir_ty/src/diagnostics/pattern/pat_util.rs index f8ad4e7c6..eb0b07a52 100644 --- a/crates/hir_ty/src/diagnostics/pattern/pat_util.rs +++ b/crates/hir_ty/src/diagnostics/pattern/pat_util.rs @@ -1,6 +1,6 @@ use std::iter::{Enumerate, ExactSizeIterator}; -pub struct EnumerateAndAdjust { +pub(crate) struct EnumerateAndAdjust { enumerate: Enumerate, gap_pos: usize, gap_len: usize, @@ -23,7 +23,7 @@ where } } -pub trait EnumerateAndAdjustIterator { +pub(crate) trait EnumerateAndAdjustIterator { fn enumerate_and_adjust( self, expected_len: usize, diff --git a/crates/hir_ty/src/diagnostics/pattern/usefulness.rs b/crates/hir_ty/src/diagnostics/pattern/usefulness.rs index 3bfb7afed..76dc4412f 100644 --- a/crates/hir_ty/src/diagnostics/pattern/usefulness.rs +++ b/crates/hir_ty/src/diagnostics/pattern/usefulness.rs @@ -906,7 +906,7 @@ mod helper { /// [this comment]: https://github.com/rust-lang/rust/issues/34511#issuecomment-373423999 // FIXME(eddyb) false positive, the lifetime parameter is "phantom" but needed. #[allow(unused_lifetimes)] - pub trait Captures<'a> {} + pub(crate) trait Captures<'a> {} impl<'a, T: ?Sized> Captures<'a> for T {} } -- cgit v1.2.3