Fix visibility warnings

This commit is contained in:
Dawer 2021-05-07 12:20:23 +05:00
parent a236bfa57a
commit d7239e5ab4
3 changed files with 12 additions and 12 deletions

View File

@ -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<Pat>;
pub(crate) type PatId = Idx<Pat>;
#[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<PatKind>,
pub(crate) struct Pat {
pub(crate) ty: Ty,
pub(crate) kind: Box<PatKind>,
}
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.

View File

@ -1,6 +1,6 @@
use std::iter::{Enumerate, ExactSizeIterator};
pub struct EnumerateAndAdjust<I> {
pub(crate) struct EnumerateAndAdjust<I> {
enumerate: Enumerate<I>,
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,

View File

@ -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 {}
}