aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/diagnostics
diff options
context:
space:
mode:
authorDawer <[email protected]>2021-05-07 08:20:23 +0100
committerDawer <[email protected]>2021-05-31 20:03:47 +0100
commitd7239e5ab4a3b88e9e79cc60d80eaf7300411e5a (patch)
tree1f0d7bee0cb28a8cedbf26ede6d5a4b3cb2ed149 /crates/hir_ty/src/diagnostics
parenta236bfa57a1a860e834498d6ca1e1fc1f857a3a4 (diff)
Fix visibility warnings
Diffstat (limited to 'crates/hir_ty/src/diagnostics')
-rw-r--r--crates/hir_ty/src/diagnostics/pattern.rs18
-rw-r--r--crates/hir_ty/src/diagnostics/pattern/pat_util.rs4
-rw-r--r--crates/hir_ty/src/diagnostics/pattern/usefulness.rs2
3 files changed, 12 insertions, 12 deletions
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 @@
4mod deconstruct_pat; 4mod deconstruct_pat;
5// TODO: find a better place for this? 5// TODO: find a better place for this?
6mod pat_util; 6mod pat_util;
7pub mod usefulness; 7pub(crate) mod usefulness;
8 8
9use hir_def::{body::Body, EnumVariantId, LocalFieldId, VariantId}; 9use hir_def::{body::Body, EnumVariantId, LocalFieldId, VariantId};
10use la_arena::Idx; 10use la_arena::Idx;
@@ -13,7 +13,7 @@ use crate::{db::HirDatabase, AdtId, InferenceResult, Interner, Substitution, Ty,
13 13
14use self::pat_util::EnumerateAndAdjustIterator; 14use self::pat_util::EnumerateAndAdjustIterator;
15 15
16pub type PatId = Idx<Pat>; 16pub(crate) type PatId = Idx<Pat>;
17 17
18#[derive(Clone, Debug)] 18#[derive(Clone, Debug)]
19pub(crate) enum PatternError { 19pub(crate) enum PatternError {
@@ -21,15 +21,15 @@ pub(crate) enum PatternError {
21} 21}
22 22
23#[derive(Clone, Debug, PartialEq)] 23#[derive(Clone, Debug, PartialEq)]
24pub struct FieldPat { 24pub(crate) struct FieldPat {
25 pub field: LocalFieldId, 25 pub(crate) field: LocalFieldId,
26 pub pattern: Pat, 26 pub(crate) pattern: Pat,
27} 27}
28 28
29#[derive(Clone, Debug, PartialEq)] 29#[derive(Clone, Debug, PartialEq)]
30pub struct Pat { 30pub(crate) struct Pat {
31 pub ty: Ty, 31 pub(crate) ty: Ty,
32 pub kind: Box<PatKind>, 32 pub(crate) kind: Box<PatKind>,
33} 33}
34 34
35impl Pat { 35impl Pat {
@@ -39,7 +39,7 @@ impl Pat {
39} 39}
40 40
41#[derive(Clone, Debug, PartialEq)] 41#[derive(Clone, Debug, PartialEq)]
42pub enum PatKind { 42pub(crate) enum PatKind {
43 Wild, 43 Wild,
44 44
45 /// `x`, `ref x`, `x @ P`, etc. 45 /// `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 @@
1use std::iter::{Enumerate, ExactSizeIterator}; 1use std::iter::{Enumerate, ExactSizeIterator};
2 2
3pub struct EnumerateAndAdjust<I> { 3pub(crate) struct EnumerateAndAdjust<I> {
4 enumerate: Enumerate<I>, 4 enumerate: Enumerate<I>,
5 gap_pos: usize, 5 gap_pos: usize,
6 gap_len: usize, 6 gap_len: usize,
@@ -23,7 +23,7 @@ where
23 } 23 }
24} 24}
25 25
26pub trait EnumerateAndAdjustIterator { 26pub(crate) trait EnumerateAndAdjustIterator {
27 fn enumerate_and_adjust( 27 fn enumerate_and_adjust(
28 self, 28 self,
29 expected_len: usize, 29 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 {
906 /// [this comment]: https://github.com/rust-lang/rust/issues/34511#issuecomment-373423999 906 /// [this comment]: https://github.com/rust-lang/rust/issues/34511#issuecomment-373423999
907 // FIXME(eddyb) false positive, the lifetime parameter is "phantom" but needed. 907 // FIXME(eddyb) false positive, the lifetime parameter is "phantom" but needed.
908 #[allow(unused_lifetimes)] 908 #[allow(unused_lifetimes)]
909 pub trait Captures<'a> {} 909 pub(crate) trait Captures<'a> {}
910 910
911 impl<'a, T: ?Sized> Captures<'a> for T {} 911 impl<'a, T: ?Sized> Captures<'a> for T {}
912} 912}