Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 728a864

Browse files
committedNov 14, 2023
remove parser fluent from rustc_expand
1 parent bf3b14d commit 728a864

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed
 

‎compiler/rustc_expand/src/parse/tests.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ use rustc_span::{BytePos, FileName, Pos, Span};
2020
use std::path::PathBuf;
2121

2222
fn sess() -> ParseSess {
23-
ParseSess::new(
24-
vec![crate::DEFAULT_LOCALE_RESOURCE, rustc_parse::DEFAULT_LOCALE_RESOURCE],
25-
FilePathMapping::empty(),
26-
)
23+
ParseSess::new(vec![crate::DEFAULT_LOCALE_RESOURCE], FilePathMapping::empty())
2724
}
2825

2926
/// Parses an item.

‎compiler/rustc_expand/src/tests.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,8 @@ fn string_to_parser(ps: &ParseSess, source_str: String) -> Parser<'_> {
2626
fn create_test_handler() -> (Handler, Lrc<SourceMap>, Arc<Mutex<Vec<u8>>>) {
2727
let output = Arc::new(Mutex::new(Vec::new()));
2828
let source_map = Lrc::new(SourceMap::new(FilePathMapping::empty()));
29-
let fallback_bundle = rustc_errors::fallback_fluent_bundle(
30-
vec![crate::DEFAULT_LOCALE_RESOURCE, rustc_parse::DEFAULT_LOCALE_RESOURCE],
31-
false,
32-
);
29+
let fallback_bundle =
30+
rustc_errors::fallback_fluent_bundle(vec![crate::DEFAULT_LOCALE_RESOURCE], false);
3331
let emitter = EmitterWriter::new(Box::new(Shared { data: output.clone() }), fallback_bundle)
3432
.sm(Some(source_map.clone()))
3533
.diagnostic_width(Some(140));
@@ -72,10 +70,7 @@ where
7270

7371
/// Maps a string to tts, using a made-up filename.
7472
pub(crate) fn string_to_stream(source_str: String) -> TokenStream {
75-
let ps = ParseSess::new(
76-
vec![crate::DEFAULT_LOCALE_RESOURCE, rustc_parse::DEFAULT_LOCALE_RESOURCE],
77-
FilePathMapping::empty(),
78-
);
73+
let ps = ParseSess::new(vec![crate::DEFAULT_LOCALE_RESOURCE], FilePathMapping::empty());
7974
source_file_to_stream(
8075
&ps,
8176
ps.source_map().new_source_file(PathBuf::from("bogofile").into(), source_str),
@@ -85,10 +80,7 @@ pub(crate) fn string_to_stream(source_str: String) -> TokenStream {
8580

8681
/// Parses a string, returns a crate.
8782
pub(crate) fn string_to_crate(source_str: String) -> ast::Crate {
88-
let ps = ParseSess::new(
89-
vec![crate::DEFAULT_LOCALE_RESOURCE, rustc_parse::DEFAULT_LOCALE_RESOURCE],
90-
FilePathMapping::empty(),
91-
);
83+
let ps = ParseSess::new(vec![crate::DEFAULT_LOCALE_RESOURCE], FilePathMapping::empty());
9284
with_error_checking_parse(source_str, &ps, |p| p.parse_crate_mod())
9385
}
9486

0 commit comments

Comments
 (0)
Please sign in to comment.