From b6101184537b1165cfdd5fc473e04ad4c5b7bffa Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 2 Nov 2020 13:13:32 +0100 Subject: Deny unreachable-pub It's very useful when `pub` is equivalent to "this is crate's public API", let's enforce this! Ideally, we should enforce it for local `cargo test`, and only during CI, but that needs https://github.com/rust-lang/cargo/issues/5034. --- crates/hir_ty/src/diagnostics/unsafe_check.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/hir_ty/src/diagnostics/unsafe_check.rs') diff --git a/crates/hir_ty/src/diagnostics/unsafe_check.rs b/crates/hir_ty/src/diagnostics/unsafe_check.rs index 2da9688ca..6dc862826 100644 --- a/crates/hir_ty/src/diagnostics/unsafe_check.rs +++ b/crates/hir_ty/src/diagnostics/unsafe_check.rs @@ -59,12 +59,12 @@ impl<'a, 'b> UnsafeValidator<'a, 'b> { } } -pub struct UnsafeExpr { - pub expr: ExprId, - pub inside_unsafe_block: bool, +pub(crate) struct UnsafeExpr { + pub(crate) expr: ExprId, + pub(crate) inside_unsafe_block: bool, } -pub fn unsafe_expressions( +pub(crate) fn unsafe_expressions( db: &dyn HirDatabase, infer: &InferenceResult, def: DefWithBodyId, -- cgit v1.2.3