File tree 2 files changed +29
-1
lines changed
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -1168,7 +1168,15 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
1168
1168
} )
1169
1169
} ) ;
1170
1170
1171
- let debugging_opts = build_debugging_options ( matches, error_format) ;
1171
+ let mut debugging_opts = build_debugging_options ( matches, error_format) ;
1172
+
1173
+ // Incremental compilation only works reliably when translation is done via
1174
+ // MIR, so let's enable -Z orbit if necessary (see #34973).
1175
+ if debugging_opts. incremental . is_some ( ) && !debugging_opts. orbit {
1176
+ early_warn ( error_format, "Automatically enabling `-Z orbit` because \
1177
+ `-Z incremental` was specified") ;
1178
+ debugging_opts. orbit = true ;
1179
+ }
1172
1180
1173
1181
let parse_only = debugging_opts. parse_only ;
1174
1182
let no_trans = debugging_opts. no_trans ;
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ // ignore-pretty
12
+ // compile-flags:-Zincremental=tmp/cfail-tests/enable-orbit-for-incr-comp -Zorbit=off
13
+ // error-pattern:Automatically enabling `-Z orbit` because `-Z incremental` was specified
14
+
15
+ #![ deny( warnings) ]
16
+
17
+ fn main ( ) {
18
+ FAIL ! // We just need some compilation error. What we really care about is
19
+ // that the error pattern above is checked.
20
+ }
You can’t perform that action at this time.
0 commit comments