@@ -26,10 +26,8 @@ fn string_to_parser(ps: &ParseSess, source_str: String) -> Parser<'_> {
2626fn 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 ) ) ;
7270
7371/// Maps a string to tts, using a made-up filename.
7472pub ( 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.
8782pub ( 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