diff options
Diffstat (limited to 'crates/hir_ty/src/diagnostics')
-rw-r--r-- | crates/hir_ty/src/diagnostics/pattern.rs | 18 | ||||
-rw-r--r-- | crates/hir_ty/src/diagnostics/pattern/pat_util.rs | 4 | ||||
-rw-r--r-- | crates/hir_ty/src/diagnostics/pattern/usefulness.rs | 2 |
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 @@ | |||
4 | mod deconstruct_pat; | 4 | mod deconstruct_pat; |
5 | // TODO: find a better place for this? | 5 | // TODO: find a better place for this? |
6 | mod pat_util; | 6 | mod pat_util; |
7 | pub mod usefulness; | 7 | pub(crate) mod usefulness; |
8 | 8 | ||
9 | use hir_def::{body::Body, EnumVariantId, LocalFieldId, VariantId}; | 9 | use hir_def::{body::Body, EnumVariantId, LocalFieldId, VariantId}; |
10 | use la_arena::Idx; | 10 | use la_arena::Idx; |
@@ -13,7 +13,7 @@ use crate::{db::HirDatabase, AdtId, InferenceResult, Interner, Substitution, Ty, | |||
13 | 13 | ||
14 | use self::pat_util::EnumerateAndAdjustIterator; | 14 | use self::pat_util::EnumerateAndAdjustIterator; |
15 | 15 | ||
16 | pub type PatId = Idx<Pat>; | 16 | pub(crate) type PatId = Idx<Pat>; |
17 | 17 | ||
18 | #[derive(Clone, Debug)] | 18 | #[derive(Clone, Debug)] |
19 | pub(crate) enum PatternError { | 19 | pub(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)] |
24 | pub struct FieldPat { | 24 | pub(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)] |
30 | pub struct Pat { | 30 | pub(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 | ||
35 | impl Pat { | 35 | impl Pat { |
@@ -39,7 +39,7 @@ impl Pat { | |||
39 | } | 39 | } |
40 | 40 | ||
41 | #[derive(Clone, Debug, PartialEq)] | 41 | #[derive(Clone, Debug, PartialEq)] |
42 | pub enum PatKind { | 42 | pub(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 @@ | |||
1 | use std::iter::{Enumerate, ExactSizeIterator}; | 1 | use std::iter::{Enumerate, ExactSizeIterator}; |
2 | 2 | ||
3 | pub struct EnumerateAndAdjust<I> { | 3 | pub(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 | ||
26 | pub trait EnumerateAndAdjustIterator { | 26 | pub(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 | } |