File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ use test_log::test;
88// smoelius: The channel date is one day later than the `rustc --version` date.
99// smoelius: Put recent boundaries first, since they're more likely to cause problems.
1010// smoelius: The relevant PRs and merge commits appear before each boundary.
11- const BOUNDARIES : [ ( & str , & str ) ; 4 ] = [
11+ const BOUNDARIES : [ ( & str , & str ) ; 5 ] = [
12+ // https://github.com/rust-lang/rust/pull/111748
13+ // https://github.com/rust-lang/rust/commit/70e04bd88d85cab8ed110ace5a278fab106d0ef5
14+ ( "2023-05-29" , "2023-05-30" ) ,
1215 // https://github.com/rust-lang/rust/pull/111633
1316 // https://github.com/rust-lang/rust/commit/08efb9d652c840715d15954592426e2befe13b36
1417 ( "2023-05-18" , "2023-05-19" ) ,
Original file line number Diff line number Diff line change @@ -119,14 +119,17 @@ 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+ // smoelius: And rust-lang/rust#111748 made it that `msg` is borrowed for
123+ // `'static`. Since the program is about to exit, it's probably fine to leak the
124+ // string.
125+ let msg = format ! (
126+ "could not load library `{}`: {}" ,
127+ path. to_string_lossy( ) ,
128+ err
129+ ) ;
122130 rustc_session:: early_error (
123131 rustc_session:: config:: ErrorOutputType :: default ( ) ,
124- format ! (
125- "could not load library `{}`: {}" ,
126- path. to_string_lossy( ) ,
127- err
128- )
129- . as_str ( ) ,
132+ Box :: leak ( msg. into_boxed_str ( ) ) as & str ,
130133 ) ;
131134 } ) ;
132135
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+ Box :: leak ( msg . into_boxed_str ( ) ) as & str ,
461462 ) ;
462463 } ) ;
463464}
You can’t perform that action at this time.
0 commit comments