blob: 24d2dc645519dff4b62e8dc28eb3fc89017e4f88 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// run-pass
// aux-build:ver-cfg-rel.rs
// revisions: assume no_assume
// [assume]compile-flags: -Z assume-incomplete-release
#![feature(cfg_version)]
extern crate ver_cfg_rel;
use ver_cfg_rel::ver_cfg_rel;
#[ver_cfg_rel("-2")]
fn foo_2() { }
#[ver_cfg_rel("-1")]
fn foo_1() { }
#[cfg(assume)]
#[ver_cfg_rel("0")]
fn foo() { compile_error!("wrong+0") }
#[cfg(no_assume)]
#[ver_cfg_rel("0")]
fn foo() { }
#[ver_cfg_rel("1")]
fn bar() { compile_error!("wrong+1") }
#[ver_cfg_rel("2")]
fn bar() { compile_error!("wrong+2") }
fn main() {
foo_2();
foo_1();
#[cfg(no_assume)]
foo();
}
|