diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-05-31 13:39:24 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-06-05 10:38:02 +1000 |
| commit | 191b76ef3116736416c28d39d35102c78cb33a07 (patch) | |
| tree | 43cfe6da0828236238f13bd0a15876dbaa6da403 /compiler/rustc_parse/src | |
| parent | 29e6e2859be6ea69a486bdc155df9311455f55dc (diff) | |
| download | rust-191b76ef3116736416c28d39d35102c78cb33a07.tar.gz rust-191b76ef3116736416c28d39d35102c78cb33a07.zip | |
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`.
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs index 2c5a0abc6ac..1a0535684e8 100644 --- a/compiler/rustc_parse/src/lib.rs +++ b/compiler/rustc_parse/src/lib.rs @@ -89,7 +89,7 @@ pub fn maybe_new_parser_from_source_str( name: FileName, source: String, ) -> Result<Parser<'_>, Vec<Diag<'_>>> { - maybe_source_file_to_parser(psess, psess.source_map().new_source_file(name, source)) + maybe_new_parser_from_source_file(psess, psess.source_map().new_source_file(name, source)) } /// 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 err.emit(); }); - unwrap_or_emit_fatal(maybe_source_file_to_parser(psess, source_file)) + unwrap_or_emit_fatal(maybe_new_parser_from_source_file(psess, source_file)) } /// Given a session and a `source_file`, return a parser. Returns any buffered errors from lexing /// the initial token stream. -fn maybe_source_file_to_parser( +fn maybe_new_parser_from_source_file( psess: &ParseSess, source_file: Lrc<SourceFile>, ) -> Result<Parser<'_>, Vec<Diag<'_>>> { |
