File tree Expand file tree Collapse file tree 3 files changed +41
-8
lines changed Expand file tree Collapse file tree 3 files changed +41
-8
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ use tempfile::tempdir;
8
8
// smoelius: Put recent boundaries first, since they're more likely to cause problems.
9
9
// smoelius: The relevant PRs and merge commits appear before each boundary.
10
10
const BOUNDARIES : & [ ( & str , & str ) ] = & [
11
+ // https://github.com/rust-lang/rust/pull/112692
12
+ // https://github.com/rust-lang/rust/commit/b6144cd843d6eb6acc086797ea37e0c69c892b90
13
+ ( "2023-06-28" , "2023-06-29" ) ,
11
14
// https://github.com/rust-lang/rust/pull/111748
12
15
// https://github.com/rust-lang/rust/commit/70e04bd88d85cab8ed110ace5a278fab106d0ef5
13
16
( "2023-05-29" , "2023-05-30" ) ,
Original file line number Diff line number Diff line change @@ -127,10 +127,7 @@ impl Callbacks {
127
127
path. to_string_lossy( ) ,
128
128
err
129
129
) ;
130
- rustc_session:: early_error (
131
- rustc_session:: config:: ErrorOutputType :: default ( ) ,
132
- Box :: leak ( msg. into_boxed_str ( ) ) as & str ,
133
- ) ;
130
+ early_error ( msg) ;
134
131
} ) ;
135
132
136
133
loaded_libs. push ( LoadedLibrary { path, lib } ) ;
@@ -140,6 +137,24 @@ impl Callbacks {
140
137
}
141
138
}
142
139
140
+ #[ rustversion:: before( 2023 -06 -28 ) ]
141
+ fn early_error ( msg : String ) -> ! {
142
+ rustc_session:: early_error (
143
+ rustc_session:: config:: ErrorOutputType :: default ( ) ,
144
+ Box :: leak ( msg. into_boxed_str ( ) ) as & str ,
145
+ )
146
+ }
147
+
148
+ #[ rustversion:: since( 2023 -06 -28 ) ]
149
+ extern crate rustc_errors;
150
+
151
+ #[ rustversion:: since( 2023 -06 -28 ) ]
152
+ fn early_error ( msg : impl Into < rustc_errors:: DiagnosticMessage > ) -> ! {
153
+ let handler =
154
+ rustc_session:: EarlyErrorHandler :: new ( rustc_session:: config:: ErrorOutputType :: default ( ) ) ;
155
+ handler. early_error ( msg)
156
+ }
157
+
143
158
#[ rustversion:: before( 2022 -07 -14 ) ]
144
159
fn zero_mir_opt_level ( config : & mut rustc_interface:: Config ) {
145
160
trait Zeroable {
Original file line number Diff line number Diff line change @@ -456,10 +456,7 @@ pub fn config_toml(name: &str) -> ConfigResult<Option<toml::Value>> {
456
456
pub fn init_config ( sess : & rustc_session:: Session ) {
457
457
try_init_config ( sess) . unwrap_or_else ( |err| {
458
458
let msg = format ! ( "could not read configuration file: {err}" ) ;
459
- rustc_session:: early_error (
460
- rustc_session:: config:: ErrorOutputType :: default ( ) ,
461
- Box :: leak ( msg. into_boxed_str ( ) ) as & str ,
462
- ) ;
459
+ early_error ( msg) ;
463
460
} ) ;
464
461
}
465
462
@@ -565,3 +562,21 @@ fn local_crate_source_file(sess: &rustc_session::Session) -> Option<PathBuf> {
565
562
fn local_crate_source_file ( sess : & rustc_session:: Session ) -> Option < PathBuf > {
566
563
sess. local_crate_source_file ( )
567
564
}
565
+
566
+ #[ rustversion:: before( 2023 -06 -28 ) ]
567
+ fn early_error ( msg : String ) -> ! {
568
+ rustc_session:: early_error (
569
+ rustc_session:: config:: ErrorOutputType :: default ( ) ,
570
+ Box :: leak ( msg. into_boxed_str ( ) ) as & str ,
571
+ )
572
+ }
573
+
574
+ #[ rustversion:: since( 2023 -06 -28 ) ]
575
+ extern crate rustc_errors;
576
+
577
+ #[ rustversion:: since( 2023 -06 -28 ) ]
578
+ fn early_error ( msg : impl Into < rustc_errors:: DiagnosticMessage > ) -> ! {
579
+ let handler =
580
+ rustc_session:: EarlyErrorHandler :: new ( rustc_session:: config:: ErrorOutputType :: default ( ) ) ;
581
+ handler. early_error ( msg)
582
+ }
You can’t perform that action at this time.
0 commit comments