Skip to content

Commit 191b76e

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 29e6e28 commit 191b76e

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub fn maybe_new_parser_from_source_str(
8989
name: FileName,
9090
source: String,
9191
) -> Result<Parser<'_>, Vec<Diag<'_>>> {
92-
maybe_source_file_to_parser(psess, psess.source_map().new_source_file(name, source))
92+
maybe_new_parser_from_source_file(psess, psess.source_map().new_source_file(name, source))
9393
}
9494

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

107-
unwrap_or_emit_fatal(maybe_source_file_to_parser(psess, source_file))
107+
unwrap_or_emit_fatal(maybe_new_parser_from_source_file(psess, source_file))
108108
}
109109

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

0 commit comments

Comments
 (0)