-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
101 additions
and
8 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
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,10 @@ | ||
// run-pass | ||
#![feature(cfg_target)] | ||
|
||
#[cfg(target = "x86_64-unknown-linux-gnu")] | ||
pub fn main() { | ||
} | ||
|
||
#[cfg(not(target = "x86_64-unknown-linux-gnu"))] | ||
pub 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#[cfg(target = "x")] //~ ERROR `cfg(target)` is experimental | ||
struct Foo(u64, u64); | ||
|
||
#[cfg_attr(target = "x", x)] //~ ERROR `cfg(target)` is experimental | ||
struct Bar(u64, u64); | ||
|
||
#[cfg(not(any(all(target = "x"))))] //~ ERROR `cfg(target)` is experimental | ||
fn foo() {} | ||
|
||
fn main() { | ||
cfg!(target = "x"); | ||
//~^ ERROR `cfg(target)` is experimental and subject to change | ||
} |
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,39 @@ | ||
error[E0658]: `cfg(target)` is experimental and subject to change | ||
--> $DIR/feature-gate-cfg-target.rs:1:7 | ||
| | ||
LL | #[cfg(target = "x")] | ||
| ^^^^^^^^^^^^ | ||
| | ||
= note: see issue #96901 <https://github.com/rust-lang/rust/issues/96901> for more information | ||
= help: add `#![feature(cfg_target)]` to the crate attributes to enable | ||
|
||
error[E0658]: `cfg(target)` is experimental and subject to change | ||
--> $DIR/feature-gate-cfg-target.rs:4:12 | ||
| | ||
LL | #[cfg_attr(target = "x", x)] | ||
| ^^^^^^^^^^^^ | ||
| | ||
= note: see issue #96901 <https://github.com/rust-lang/rust/issues/96901> for more information | ||
= help: add `#![feature(cfg_target)]` to the crate attributes to enable | ||
|
||
error[E0658]: `cfg(target)` is experimental and subject to change | ||
--> $DIR/feature-gate-cfg-target.rs:7:19 | ||
| | ||
LL | #[cfg(not(any(all(target = "x"))))] | ||
| ^^^^^^^^^^^^ | ||
| | ||
= note: see issue #96901 <https://github.com/rust-lang/rust/issues/96901> for more information | ||
= help: add `#![feature(cfg_target)]` to the crate attributes to enable | ||
|
||
error[E0658]: `cfg(target)` is experimental and subject to change | ||
--> $DIR/feature-gate-cfg-target.rs:11:10 | ||
| | ||
LL | cfg!(target = "x"); | ||
| ^^^^^^^^^^^^ | ||
| | ||
= note: see issue #96901 <https://github.com/rust-lang/rust/issues/96901> for more information | ||
= help: add `#![feature(cfg_target)]` to the crate attributes to enable | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |