Skip to content

Commit f9bb5df

Browse files
committed
narrow down visibilities in rustc_parse::lexer
1 parent 5ae5d13 commit f9bb5df

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

compiler/rustc_parse/src/lexer/diagnostics.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_span::source_map::SourceMap;
55
use rustc_span::Span;
66

77
#[derive(Default)]
8-
pub struct TokenTreeDiagInfo {
8+
pub(super) struct TokenTreeDiagInfo {
99
/// Stack of open delimiters and their spans. Used for error message.
1010
pub open_braces: Vec<(Delimiter, Span)>,
1111
pub unmatched_delims: Vec<UnmatchedDelim>,
@@ -21,7 +21,7 @@ pub struct TokenTreeDiagInfo {
2121
pub matching_block_spans: Vec<(Span, Span)>,
2222
}
2323

24-
pub fn same_indentation_level(sm: &SourceMap, open_sp: Span, close_sp: Span) -> bool {
24+
pub(super) fn same_indentation_level(sm: &SourceMap, open_sp: Span, close_sp: Span) -> bool {
2525
match (sm.span_to_margin(open_sp), sm.span_to_margin(close_sp)) {
2626
(Some(open_padding), Some(close_padding)) => open_padding == close_padding,
2727
_ => false,
@@ -30,7 +30,7 @@ pub fn same_indentation_level(sm: &SourceMap, open_sp: Span, close_sp: Span) ->
3030

3131
// When we get a `)` or `]` for `{`, we should emit help message here
3232
// it's more friendly compared to report `unmatched error` in later phase
33-
pub fn report_missing_open_delim(err: &mut Diag<'_>, unmatched_delims: &[UnmatchedDelim]) -> bool {
33+
fn report_missing_open_delim(err: &mut Diag<'_>, unmatched_delims: &[UnmatchedDelim]) -> bool {
3434
let mut reported_missing_open = false;
3535
for unmatch_brace in unmatched_delims.iter() {
3636
if let Some(delim) = unmatch_brace.found_delim
@@ -51,7 +51,7 @@ pub fn report_missing_open_delim(err: &mut Diag<'_>, unmatched_delims: &[Unmatch
5151
reported_missing_open
5252
}
5353

54-
pub fn report_suspicious_mismatch_block(
54+
pub(super) fn report_suspicious_mismatch_block(
5555
err: &mut Diag<'_>,
5656
diag_info: &TokenTreeDiagInfo,
5757
sm: &SourceMap,

compiler/rustc_parse/src/lexer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct StringReader<'psess, 'src> {
112112
}
113113

114114
impl<'psess, 'src> StringReader<'psess, 'src> {
115-
pub fn dcx(&self) -> &'psess DiagCtxt {
115+
fn dcx(&self) -> &'psess DiagCtxt {
116116
&self.psess.dcx
117117
}
118118

compiler/rustc_parse/src/lexer/unicode_chars.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{
99
use rustc_span::{symbol::kw, BytePos, Pos, Span};
1010

1111
#[rustfmt::skip] // for line breaks
12-
pub(crate) const UNICODE_ARRAY: &[(char, &str, &str)] = &[
12+
pub(super) const UNICODE_ARRAY: &[(char, &str, &str)] = &[
1313
('
', "Line Separator", " "),
1414
('
', "Paragraph Separator", " "),
1515
(' ', "Ogham Space mark", " "),

0 commit comments

Comments
 (0)