diff options
| author | Lin Yihai <linyihai@huawei.com> | 2024-05-07 11:02:28 +0800 |
|---|---|---|
| committer | Lin Yihai <linyihai@huawei.com> | 2024-05-07 11:02:28 +0800 |
| commit | f9bb5df5a0655190ed4f0d33cebbe6116c3f2eb1 (patch) | |
| tree | ba393bab0869cc7ea198dd462a761e85e9241e0a /compiler/rustc_parse/src/lexer/diagnostics.rs | |
| parent | 5ae5d135372c4b576edc73c191d2dc86b1d16b5c (diff) | |
| download | rust-f9bb5df5a0655190ed4f0d33cebbe6116c3f2eb1.tar.gz rust-f9bb5df5a0655190ed4f0d33cebbe6116c3f2eb1.zip | |
narrow down visibilities in `rustc_parse::lexer`
Diffstat (limited to 'compiler/rustc_parse/src/lexer/diagnostics.rs')
| -rw-r--r-- | compiler/rustc_parse/src/lexer/diagnostics.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/lexer/diagnostics.rs b/compiler/rustc_parse/src/lexer/diagnostics.rs index 993ff1b97f5..1247e2e44fb 100644 --- a/compiler/rustc_parse/src/lexer/diagnostics.rs +++ b/compiler/rustc_parse/src/lexer/diagnostics.rs @@ -5,7 +5,7 @@ use rustc_span::source_map::SourceMap; use rustc_span::Span; #[derive(Default)] -pub struct TokenTreeDiagInfo { +pub(super) struct TokenTreeDiagInfo { /// Stack of open delimiters and their spans. Used for error message. pub open_braces: Vec<(Delimiter, Span)>, pub unmatched_delims: Vec<UnmatchedDelim>, @@ -21,7 +21,7 @@ pub struct TokenTreeDiagInfo { pub matching_block_spans: Vec<(Span, Span)>, } -pub fn same_indentation_level(sm: &SourceMap, open_sp: Span, close_sp: Span) -> bool { +pub(super) fn same_indentation_level(sm: &SourceMap, open_sp: Span, close_sp: Span) -> bool { match (sm.span_to_margin(open_sp), sm.span_to_margin(close_sp)) { (Some(open_padding), Some(close_padding)) => open_padding == close_padding, _ => false, @@ -30,7 +30,7 @@ pub fn same_indentation_level(sm: &SourceMap, open_sp: Span, close_sp: Span) -> // When we get a `)` or `]` for `{`, we should emit help message here // it's more friendly compared to report `unmatched error` in later phase -pub fn report_missing_open_delim(err: &mut Diag<'_>, unmatched_delims: &[UnmatchedDelim]) -> bool { +fn report_missing_open_delim(err: &mut Diag<'_>, unmatched_delims: &[UnmatchedDelim]) -> bool { let mut reported_missing_open = false; for unmatch_brace in unmatched_delims.iter() { if let Some(delim) = unmatch_brace.found_delim @@ -51,7 +51,7 @@ pub fn report_missing_open_delim(err: &mut Diag<'_>, unmatched_delims: &[Unmatch reported_missing_open } -pub fn report_suspicious_mismatch_block( +pub(super) fn report_suspicious_mismatch_block( err: &mut Diag<'_>, diag_info: &TokenTreeDiagInfo, sm: &SourceMap, |
