File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -1143,7 +1143,15 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
1143
1143
} )
1144
1144
} ) ;
1145
1145
1146
- let debugging_opts = build_debugging_options ( matches, error_format) ;
1146
+ let mut debugging_opts = build_debugging_options ( matches, error_format) ;
1147
+
1148
+ // Incremental compilation only works reliably when translation is done via
1149
+ // MIR, so let's enable -Z orbit if necessary (see #34973).
1150
+ if debugging_opts. incremental . is_some ( ) && !debugging_opts. orbit {
1151
+ early_warn ( error_format, "Automatically enabling `-Z orbit` because \
1152
+ `-Z incremental` was specified") ;
1153
+ debugging_opts. orbit = true ;
1154
+ }
1147
1155
1148
1156
let parse_only = debugging_opts. parse_only ;
1149
1157
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