File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
29
29
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
30
30
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
31
31
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32
- refs/heads/stable: 4c4bb5ff5c5d660c565d6d79f2204e23b673d39e
32
+ refs/heads/stable: 6d2c866e22ad1999d4a16b6b7345e031ef74655c
33
33
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
34
34
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
35
35
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e
Original file line number Diff line number Diff line change @@ -348,10 +348,24 @@ fn handle_explain(code: &str,
348
348
}
349
349
}
350
350
351
+ fn check_cfg ( sopts : & config:: Options ,
352
+ output : ErrorOutputType ) {
353
+ fn is_meta_list ( item : & ast:: MetaItem ) -> bool {
354
+ match item. node {
355
+ ast:: MetaItem_ :: MetaList ( ..) => true ,
356
+ _ => false ,
357
+ }
358
+ }
359
+
360
+ if sopts. cfg . iter ( ) . any ( |item| is_meta_list ( & * item) ) {
361
+ early_error ( output, "predicates are not allowed in --cfg" ) ;
362
+ }
363
+ }
364
+
351
365
impl < ' a > CompilerCalls < ' a > for RustcDefaultCalls {
352
366
fn early_callback ( & mut self ,
353
367
matches : & getopts:: Matches ,
354
- _sopts : & config:: Options ,
368
+ sopts : & config:: Options ,
355
369
descriptions : & diagnostics:: registry:: Registry ,
356
370
output : ErrorOutputType )
357
371
-> Compilation {
@@ -360,6 +374,7 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
360
374
return Compilation :: Stop ;
361
375
}
362
376
377
+ check_cfg ( sopts, output) ;
363
378
Compilation :: Continue
364
379
}
365
380
Original file line number Diff line number Diff line change
1
+ // Copyright 2015 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
+ // compile-flags: --cfg foo(bar)
12
+ // error-pattern: predicates are not allowed in --cfg
13
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments