forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#123577 - Urgau:prep-work-for-compiletest-chec…
…k-cfg, r=oli-obk Do some preparation work for compiletest check-cfg This PR does several preparation work for having always-on check-cfg in compiletest. In particular, this PR does two main things: - It unifies all the *always-false* cfgs under the `FALSE` cfg (as it seems to be the convention under `tests/ui`) - It also removes some useless conditions This is done ahead of the introduction of the always-on check-cfg in compiletest to reduce the amount of changes in that follow-up work. I also think that this is useful even without that follow-up work.
- Loading branch information
Showing
43 changed files
with
121 additions
and
165 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
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
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)] |
Oops, something went wrong.