File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,14 +119,14 @@ impl Callbacks {
119119 let lib = result. unwrap_or_else ( |err| {
120120 // smoelius: rust-lang/rust#111633 changed the type of `early_error`'s `msg`
121121 // argument from `&str` to `impl Into<DiagnosticMessage>`.
122+ let msg = format ! (
123+ "could not load library `{}`: {}" ,
124+ path. to_string_lossy( ) ,
125+ err
126+ ) ;
122127 rustc_session:: early_error (
123128 rustc_session:: config:: ErrorOutputType :: default ( ) ,
124- format ! (
125- "could not load library `{}`: {}" ,
126- path. to_string_lossy( ) ,
127- err
128- )
129- . as_str ( ) ,
129+ msg. as_str ( ) ,
130130 ) ;
131131 } ) ;
132132
Original file line number Diff line number Diff line change @@ -455,9 +455,10 @@ pub fn config_toml(name: &str) -> ConfigResult<Option<toml::Value>> {
455455/// etc. includes a call to `init_config`.
456456pub fn init_config ( sess : & rustc_session:: Session ) {
457457 try_init_config ( sess) . unwrap_or_else ( |err| {
458+ let msg = format ! ( "could not read configuration file: {err}" ) ;
458459 rustc_session:: early_error (
459460 rustc_session:: config:: ErrorOutputType :: default ( ) ,
460- format ! ( "could not read configuration file: {err}" ) . as_str ( ) ,
461+ msg . as_str ( ) ,
461462 ) ;
462463 } ) ;
463464}
You can’t perform that action at this time.
0 commit comments