File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ use test_log::test;
8
8
// smoelius: The channel date is one day later than the `rustc --version` date.
9
9
// smoelius: Put recent boundaries first, since they're more likely to cause problems.
10
10
// 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" ) ,
12
15
// https://github.com/rust-lang/rust/pull/111633
13
16
// https://github.com/rust-lang/rust/commit/08efb9d652c840715d15954592426e2befe13b36
14
17
( "2023-05-18" , "2023-05-19" ) ,
Original file line number Diff line number Diff line change 1
1
#![ feature( rustc_private) ]
2
+ #![ feature( string_leak) ]
2
3
#![ deny( clippy:: expect_used) ]
3
4
#![ deny( clippy:: unwrap_used) ]
4
5
#![ deny( clippy:: panic) ]
@@ -119,14 +120,17 @@ impl Callbacks {
119
120
let lib = result. unwrap_or_else ( |err| {
120
121
// smoelius: rust-lang/rust#111633 changed the type of `early_error`'s `msg`
121
122
// argument from `&str` to `impl Into<DiagnosticMessage>`.
123
+ // smoelius: And rust-lang/rust#111748 made it that `msg` is borrowed for
124
+ // `'static`. Since the program is about to exit, it's probably fine to leak the
125
+ // string.
122
126
rustc_session:: early_error (
123
127
rustc_session:: config:: ErrorOutputType :: default ( ) ,
124
128
format ! (
125
129
"could not load library `{}`: {}" ,
126
130
path. to_string_lossy( ) ,
127
131
err
128
132
)
129
- . as_str ( ) ,
133
+ . leak ( ) as & str ,
130
134
) ;
131
135
} ) ;
132
136
Original file line number Diff line number Diff line change 168
168
//! [examples]: ../../examples
169
169
170
170
#![ feature( rustc_private) ]
171
+ #![ feature( string_leak) ]
171
172
#![ warn( unused_extern_crates) ]
172
173
173
174
#[ allow( unused_extern_crates) ]
@@ -457,7 +458,7 @@ pub fn init_config(sess: &rustc_session::Session) {
457
458
try_init_config ( sess) . unwrap_or_else ( |err| {
458
459
rustc_session:: early_error (
459
460
rustc_session:: config:: ErrorOutputType :: default ( ) ,
460
- format ! ( "could not read configuration file: {err}" ) . as_str ( ) ,
461
+ format ! ( "could not read configuration file: {err}" ) . leak ( ) as & str ,
461
462
) ;
462
463
} ) ;
463
464
}
You can’t perform that action at this time.
0 commit comments