Skip to content

Commit 93c3c10

Browse files
committed
Rename maybe_source_file_to_parser as maybe_new_parser_from_source_file.
For consistency with `new_parser_from_{file,source_str}` and `maybe_new_parser_from_source_str`.
1 parent 58002e7 commit 93c3c10

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_parse/src

1 file changed

+3
-3
lines changed

compiler/rustc_parse/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub fn maybe_new_parser_from_source_str(
8888
name: FileName,
8989
source: String,
9090
) -> Result<Parser<'_>, Vec<Diag<'_>>> {
91-
maybe_source_file_to_parser(psess, psess.source_map().new_source_file(name, source))
91+
maybe_new_parser_from_source_file(psess, psess.source_map().new_source_file(name, source))
9292
}
9393

9494
/// Creates a new parser, aborting if the file doesn't exist. If a span is given, that is used on
@@ -103,12 +103,12 @@ pub fn new_parser_from_file<'a>(psess: &'a ParseSess, path: &Path, sp: Option<Sp
103103
err.emit();
104104
});
105105

106-
unwrap_or_emit_fatal(maybe_source_file_to_parser(psess, source_file))
106+
unwrap_or_emit_fatal(maybe_new_parser_from_source_file(psess, source_file))
107107
}
108108

109109
/// Given a session and a `source_file`, return a parser. Returns any buffered errors from lexing
110110
/// the initial token stream.
111-
fn maybe_source_file_to_parser(
111+
fn maybe_new_parser_from_source_file(
112112
psess: &ParseSess,
113113
source_file: Lrc<SourceFile>,
114114
) -> Result<Parser<'_>, Vec<Diag<'_>>> {

0 commit comments

Comments
 (0)