This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ /// Test that placing a `cfg(true)` and `cfg(false)` on the same item result in
2+ //. it being disabled.`
3+
4+ #[ cfg( false ) ]
5+ #[ cfg( true ) ]
6+ fn foo ( ) { }
7+
8+ #[ cfg( true ) ]
9+ #[ cfg( false ) ]
10+ fn foo ( ) { }
11+
12+ fn main ( ) {
13+ foo ( ) ; //~ ERROR cannot find function `foo` in this scope
14+ }
Original file line number Diff line number Diff line change 1+ error[E0425]: cannot find function `foo` in this scope
2+ --> $DIR/both-true-false.rs:13:5
3+ |
4+ LL | foo();
5+ | ^^^ not found in this scope
6+
7+ error: aborting due to 1 previous error
8+
9+ For more information about this error, try `rustc --explain E0425`.
Original file line number Diff line number Diff line change 1+ /// Test that `--cfg false` doesn't cause `cfg(false)` to evaluate to `true`
2+ //@ compile-flags: --cfg false
3+
4+ #[ cfg( false ) ]
5+ fn foo ( ) { }
6+
7+ fn main ( ) {
8+ foo ( ) ; //~ ERROR cannot find function `foo` in this scope
9+ }
Original file line number Diff line number Diff line change 1+ error[E0425]: cannot find function `foo` in this scope
2+ --> $DIR/cmdline-false.rs:8:5
3+ |
4+ LL | foo();
5+ | ^^^ not found in this scope
6+
7+ error: aborting due to 1 previous error
8+
9+ For more information about this error, try `rustc --explain E0425`.
You can’t perform that action at this time.
0 commit comments