-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow setting some built-in cfg via set the command-line
- Loading branch information
Showing
25 changed files
with
197 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg debug_assertions` flag | ||
| | ||
= note: config `debug_assertions` is only supposed to be controlled by `-C debug_assertions` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg panic="abort"` flag | ||
| | ||
= note: config `panic` is only supposed to be controlled by `-C panic` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg proc_macro` flag | ||
| | ||
= note: config `proc_macro` is only supposed to be controlled by `--crate-type proc-macro` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg relocation_model="a"` flag | ||
| | ||
= note: config `relocation_model` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//@ check-fail | ||
//@ revisions: proc_macro panic target_feature unix windows target_abi | ||
//@ revisions: target_arch target_endian target_env target_family target_os target_pointer_width | ||
//@ revisions: target_vendor target_has_atomic target_has_atomic_equal_alignment | ||
//@ revisions: target_has_atomic_load_store target_thread_local relocation_model | ||
|
||
//@ [proc_macro]compile-flags: --cfg proc_macro | ||
//@ [panic]compile-flags: --cfg panic="abort" | ||
//@ [target_feature]compile-flags: --cfg target_feature="sse3" | ||
//@ [unix]compile-flags: --cfg unix | ||
//@ [windows]compile-flags: --cfg windows | ||
//@ [target_abi]compile-flags: --cfg target_abi="gnu" | ||
//@ [target_arch]compile-flags: --cfg target_arch="arm" | ||
//@ [target_endian]compile-flags: --cfg target_endian="little" | ||
//@ [target_env]compile-flags: --cfg target_env | ||
//@ [target_family]compile-flags: --cfg target_family="unix" | ||
//@ [target_os]compile-flags: --cfg target_os="linux" | ||
//@ [target_pointer_width]compile-flags: --cfg target_pointer_width="32" | ||
//@ [target_vendor]compile-flags: --cfg target_vendor | ||
//@ [target_has_atomic]compile-flags: --cfg target_has_atomic="32" | ||
//@ [target_has_atomic_equal_alignment]compile-flags: --cfg target_has_atomic_equal_alignment="32" | ||
//@ [target_has_atomic_load_store]compile-flags: --cfg target_has_atomic_load_store="32" | ||
//@ [target_thread_local]compile-flags: --cfg target_thread_local | ||
//@ [relocation_model]compile-flags: --cfg relocation_model="a" | ||
|
||
|
||
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_abi` flag | ||
| | ||
= note: config `target_abi` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_arch="arm"` flag | ||
| | ||
= note: config `target_arch` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_endian="little"` flag | ||
| | ||
= note: config `target_endian` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_env` flag | ||
| | ||
= note: config `target_env` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_family="unix"` flag | ||
| | ||
= note: config `target_family` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_feature="sse3"` flag | ||
| | ||
= note: config `target_feature` is only supposed to be controlled by `-C target-feature` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_has_atomic="32"` flag | ||
| | ||
= note: config `target_has_atomic` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
5 changes: 5 additions & 0 deletions
5
tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_equal_alignment.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_has_atomic_equal_alignment="32"` flag | ||
| | ||
= note: config `target_has_atomic_equal_alignment` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
5 changes: 5 additions & 0 deletions
5
tests/ui/cfg/disallowed-cli-cfgs.target_has_atomic_load_store.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_has_atomic_load_store="32"` flag | ||
| | ||
= note: config `target_has_atomic_load_store` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_os="linux"` flag | ||
| | ||
= note: config `target_os` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_pointer_width="32"` flag | ||
| | ||
= note: config `target_pointer_width` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_thread_local` flag | ||
| | ||
= note: config `target_thread_local` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg target_vendor` flag | ||
| | ||
= note: config `target_vendor` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg test` flag | ||
| | ||
= note: config `test` is only supposed to be controlled by `--test` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg unix` flag | ||
| | ||
= note: config `unix` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: unexpected `--cfg windows` flag | ||
| | ||
= note: config `windows` is only supposed to be controlled by `--target` | ||
= note: see <https://github.com/rust-lang/rust/issues/xxxxx> for more information | ||
|