@@ -26,10 +26,8 @@ fn string_to_parser(ps: &ParseSess, source_str: String) -> Parser<'_> {
26
26
fn create_test_handler ( ) -> ( Handler , Lrc < SourceMap > , Arc < Mutex < Vec < u8 > > > ) {
27
27
let output = Arc :: new ( Mutex :: new ( Vec :: new ( ) ) ) ;
28
28
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 ) ;
33
31
let emitter = EmitterWriter :: new ( Box :: new ( Shared { data : output. clone ( ) } ) , fallback_bundle)
34
32
. sm ( Some ( source_map. clone ( ) ) )
35
33
. diagnostic_width ( Some ( 140 ) ) ;
72
70
73
71
/// Maps a string to tts, using a made-up filename.
74
72
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 ( ) ) ;
79
74
source_file_to_stream (
80
75
& ps,
81
76
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 {
85
80
86
81
/// Parses a string, returns a crate.
87
82
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 ( ) ) ;
92
84
with_error_checking_parse ( source_str, & ps, |p| p. parse_crate_mod ( ) )
93
85
}
94
86
0 commit comments