diff options
Diffstat (limited to 'crates/hir_ty/src/diagnostics')
-rw-r--r-- | crates/hir_ty/src/diagnostics/decl_check/case_conv.rs | 6 | ||||
-rw-r--r-- | crates/hir_ty/src/diagnostics/expr.rs | 15 | ||||
-rw-r--r-- | crates/hir_ty/src/diagnostics/unsafe_check.rs | 8 |
3 files changed, 11 insertions, 18 deletions
diff --git a/crates/hir_ty/src/diagnostics/decl_check/case_conv.rs b/crates/hir_ty/src/diagnostics/decl_check/case_conv.rs index b0144a289..14e4d92f0 100644 --- a/crates/hir_ty/src/diagnostics/decl_check/case_conv.rs +++ b/crates/hir_ty/src/diagnostics/decl_check/case_conv.rs | |||
@@ -6,7 +6,7 @@ | |||
6 | 6 | ||
7 | /// Converts an identifier to an UpperCamelCase form. | 7 | /// Converts an identifier to an UpperCamelCase form. |
8 | /// Returns `None` if the string is already is UpperCamelCase. | 8 | /// Returns `None` if the string is already is UpperCamelCase. |
9 | pub fn to_camel_case(ident: &str) -> Option<String> { | 9 | pub(crate) fn to_camel_case(ident: &str) -> Option<String> { |
10 | if is_camel_case(ident) { | 10 | if is_camel_case(ident) { |
11 | return None; | 11 | return None; |
12 | } | 12 | } |
@@ -59,7 +59,7 @@ pub fn to_camel_case(ident: &str) -> Option<String> { | |||
59 | 59 | ||
60 | /// Converts an identifier to a lower_snake_case form. | 60 | /// Converts an identifier to a lower_snake_case form. |
61 | /// Returns `None` if the string is already in lower_snake_case. | 61 | /// Returns `None` if the string is already in lower_snake_case. |
62 | pub fn to_lower_snake_case(ident: &str) -> Option<String> { | 62 | pub(crate) fn to_lower_snake_case(ident: &str) -> Option<String> { |
63 | if is_lower_snake_case(ident) { | 63 | if is_lower_snake_case(ident) { |
64 | return None; | 64 | return None; |
65 | } else if is_upper_snake_case(ident) { | 65 | } else if is_upper_snake_case(ident) { |
@@ -71,7 +71,7 @@ pub fn to_lower_snake_case(ident: &str) -> Option<String> { | |||
71 | 71 | ||
72 | /// Converts an identifier to an UPPER_SNAKE_CASE form. | 72 | /// Converts an identifier to an UPPER_SNAKE_CASE form. |
73 | /// Returns `None` if the string is already is UPPER_SNAKE_CASE. | 73 | /// Returns `None` if the string is already is UPPER_SNAKE_CASE. |
74 | pub fn to_upper_snake_case(ident: &str) -> Option<String> { | 74 | pub(crate) fn to_upper_snake_case(ident: &str) -> Option<String> { |
75 | if is_upper_snake_case(ident) { | 75 | if is_upper_snake_case(ident) { |
76 | return None; | 76 | return None; |
77 | } else if is_lower_snake_case(ident) { | 77 | } else if is_lower_snake_case(ident) { |
diff --git a/crates/hir_ty/src/diagnostics/expr.rs b/crates/hir_ty/src/diagnostics/expr.rs index 278a4b947..434b19354 100644 --- a/crates/hir_ty/src/diagnostics/expr.rs +++ b/crates/hir_ty/src/diagnostics/expr.rs | |||
@@ -17,17 +17,10 @@ use crate::{ | |||
17 | ApplicationTy, InferenceResult, Ty, TypeCtor, | 17 | ApplicationTy, InferenceResult, Ty, TypeCtor, |
18 | }; | 18 | }; |
19 | 19 | ||
20 | pub use hir_def::{ | 20 | pub(crate) use hir_def::{ |
21 | body::{ | 21 | body::{Body, BodySourceMap}, |
22 | scope::{ExprScopes, ScopeEntry, ScopeId}, | 22 | expr::{Expr, ExprId, MatchArm, Pat, PatId}, |
23 | Body, BodySourceMap, ExprPtr, ExprSource, PatPtr, PatSource, | 23 | LocalFieldId, VariantId, |
24 | }, | ||
25 | expr::{ | ||
26 | ArithOp, Array, BinaryOp, BindingAnnotation, CmpOp, Expr, ExprId, Literal, LogicOp, | ||
27 | MatchArm, Ordering, Pat, PatId, RecordFieldPat, RecordLitField, Statement, UnaryOp, | ||
28 | }, | ||
29 | src::HasSource, | ||
30 | LocalFieldId, Lookup, VariantId, | ||
31 | }; | 24 | }; |
32 | 25 | ||
33 | pub(super) struct ExprValidator<'a, 'b: 'a> { | 26 | pub(super) struct ExprValidator<'a, 'b: 'a> { |
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> { | |||
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | pub struct UnsafeExpr { | 62 | pub(crate) struct UnsafeExpr { |
63 | pub expr: ExprId, | 63 | pub(crate) expr: ExprId, |
64 | pub inside_unsafe_block: bool, | 64 | pub(crate) inside_unsafe_block: bool, |
65 | } | 65 | } |
66 | 66 | ||
67 | pub fn unsafe_expressions( | 67 | pub(crate) fn unsafe_expressions( |
68 | db: &dyn HirDatabase, | 68 | db: &dyn HirDatabase, |
69 | infer: &InferenceResult, | 69 | infer: &InferenceResult, |
70 | def: DefWithBodyId, | 70 | def: DefWithBodyId, |