-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify all the always-false cfgs under the
FALSE
cfg
- Loading branch information
Showing
34 changed files
with
115 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
|
||
//@ pretty-expanded FIXME #23616 | ||
|
||
#[cfg_attr(foo, cfg(bar))] | ||
#[cfg_attr(FALSE, cfg(bar))] | ||
fn main() { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,6 @@ | |
|
||
//@ pretty-expanded FIXME #23616 | ||
|
||
#![cfg_attr(not_used, no_core)] | ||
#![cfg_attr(FALSE, no_core)] | ||
|
||
fn main() { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
// Check that `#[cfg_attr($PREDICATE,)]` triggers the `unused_attribute` lint. | ||
|
||
//@ compile-flags: --cfg TRUE | ||
|
||
#![deny(unused)] | ||
|
||
#[cfg_attr(FALSE,)] //~ ERROR `#[cfg_attr]` does not expand to any attributes | ||
fn _f() {} | ||
|
||
#[cfg_attr(TRUE,)] //~ ERROR `#[cfg_attr]` does not expand to any attributes | ||
#[cfg_attr(not(FALSE),)] //~ ERROR `#[cfg_attr]` does not expand to any attributes | ||
fn _g() {} | ||
|
||
fn main() {} |
10 changes: 5 additions & 5 deletions
10
tests/ui/conditional-compilation/cfg-attr-empty-is-unused.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
error: `#[cfg_attr]` does not expand to any attributes | ||
--> $DIR/cfg-attr-empty-is-unused.rs:7:1 | ||
--> $DIR/cfg-attr-empty-is-unused.rs:5:1 | ||
| | ||
LL | #[cfg_attr(FALSE,)] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/cfg-attr-empty-is-unused.rs:5:9 | ||
--> $DIR/cfg-attr-empty-is-unused.rs:3:9 | ||
| | ||
LL | #![deny(unused)] | ||
| ^^^^^^ | ||
= note: `#[deny(unused_attributes)]` implied by `#[deny(unused)]` | ||
|
||
error: `#[cfg_attr]` does not expand to any attributes | ||
--> $DIR/cfg-attr-empty-is-unused.rs:10:1 | ||
--> $DIR/cfg-attr-empty-is-unused.rs:8:1 | ||
| | ||
LL | #[cfg_attr(TRUE,)] | ||
| ^^^^^^^^^^^^^^^^^^ | ||
LL | #[cfg_attr(not(FALSE),)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
//@ error-pattern: `main` function not found | ||
|
||
#![cfg(bar)] | ||
#![cfg(FALSE)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.