diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-05-31 13:43:38 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-06-05 10:38:02 +1000 |
| commit | 8964106e44c39cced6cc039bf512a69513a2bbe5 (patch) | |
| tree | 8a6239c221d1e3778c8b5584851b8d989c02e7a1 /compiler/rustc_parse/src/parser/tests.rs | |
| parent | 191b76ef3116736416c28d39d35102c78cb33a07 (diff) | |
| download | rust-8964106e44c39cced6cc039bf512a69513a2bbe5.tar.gz rust-8964106e44c39cced6cc039bf512a69513a2bbe5.zip | |
Use `source_str_to_stream` in a test file.
It does exactly what is required.
Diffstat (limited to 'compiler/rustc_parse/src/parser/tests.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/tests.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/compiler/rustc_parse/src/parser/tests.rs b/compiler/rustc_parse/src/parser/tests.rs index a31e350541a..b72cfd63d00 100644 --- a/compiler/rustc_parse/src/parser/tests.rs +++ b/compiler/rustc_parse/src/parser/tests.rs @@ -1,5 +1,5 @@ use crate::parser::ForceCollect; -use crate::{new_parser_from_source_str, parser::Parser, source_file_to_stream}; +use crate::{new_parser_from_source_str, parser::Parser, source_str_to_stream}; use ast::token::IdentIsRaw; use rustc_ast::ptr::P; use rustc_ast::token::{self, Delimiter, Token}; @@ -82,11 +82,7 @@ where /// Maps a string to tts, using a made-up filename. pub(crate) fn string_to_stream(source_str: String) -> TokenStream { let psess = psess(); - source_file_to_stream( - &psess, - psess.source_map().new_source_file(PathBuf::from("bogofile").into(), source_str), - None, - ) + source_str_to_stream(PathBuf::from("bogofile").into(), source_str, &psess, None) } /// Parses a string, returns a crate. |
