diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-01-14 11:31:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-14 11:31:52 +0100 |
| commit | 74cc0be8f6388aa2fc1ecaf18904c395a2306c40 (patch) | |
| tree | d138d06c2ae67548d568775becc767e99eec48b5 /src | |
| parent | 36d68f5fb30a1bd7d3604401c03e4cf81c029a06 (diff) | |
| parent | 972bba7071d0e6b04194fa3c1108b991262dd502 (diff) | |
| download | rust-74cc0be8f6388aa2fc1ecaf18904c395a2306c40.tar.gz rust-74cc0be8f6388aa2fc1ecaf18904c395a2306c40.zip | |
Rollup merge of #57465 - jethrogb:jb/stablize-cfg-target-vendor, r=joshtriplett,Centril
Stabilize cfg_target_vendor This stabilizes the use of `cfg(target_vendor = "...")` and removes the corresponding `cfg_target_vendor` feature. Other unstable cfgs remain behind their existing feature gates. This functionality was added back in 2015 in #28612 to complete the coverage of target tuples (`<arch><sub>-<vendor>-<os>-<env>`). [RFC 131](https://github.com/rust-lang/rfcs/blob/master/text/0131-target-specification.md) governs the target specification, not including `target_vendor` seems to have just been an oversight. `target_os`, `target_family`, and `target_arch` are stable as of 1.0.0. `target_env` was also not mentioned in RFC 131, was added in #24777, never behind a feature_gate, and insta-stable at 1.1.0. The functionality is tested in [test/run-pass/cfg/cfg-target-vendor.rs](https://github.com/rust-lang/rust/blob/master/src/test/run-pass/cfg/cfg-target-vendor.rs). Closes #29718
Diffstat (limited to 'src')
| -rw-r--r-- | src/libpanic_abort/lib.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/clean/cfg.rs | 2 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 6 | ||||
| -rw-r--r-- | src/libtest/lib.rs | 2 | ||||
| -rw-r--r-- | src/libunwind/lib.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/cfg/cfg-target-vendor.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-cfg-target-vendor.rs | 11 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-cfg-target-vendor.stderr | 35 |
9 files changed, 8 insertions, 56 deletions
diff --git a/src/libpanic_abort/lib.rs b/src/libpanic_abort/lib.rs index d8dd2e0a113..8832a16d4ca 100644 --- a/src/libpanic_abort/lib.rs +++ b/src/libpanic_abort/lib.rs @@ -12,7 +12,7 @@ #![panic_runtime] #![allow(unused_features)] -#![feature(cfg_target_vendor)] +#![cfg_attr(stage0, feature(cfg_target_vendor))] #![feature(core_intrinsics)] #![feature(libc)] #![feature(nll)] diff --git a/src/librustdoc/clean/cfg.rs b/src/librustdoc/clean/cfg.rs index 0cfe6be7efb..c74a561e5a0 100644 --- a/src/librustdoc/clean/cfg.rs +++ b/src/librustdoc/clean/cfg.rs @@ -370,6 +370,7 @@ impl<'a> fmt::Display for Html<'a> { "pc" => "PC", "rumprun" => "Rumprun", "sun" => "Sun", + "fortanix" => "Fortanix", _ => "" }, ("target_env", Some(env)) => match &*env.as_str() { @@ -378,6 +379,7 @@ impl<'a> fmt::Display for Html<'a> { "musl" => "musl", "newlib" => "Newlib", "uclibc" => "uClibc", + "sgx" => "SGX", _ => "", }, ("target_endian", Some(endian)) => return write!(fmt, "{}-endian", endian), diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index e2200808449..41f1ac867ed 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -238,7 +238,7 @@ #![feature(c_variadic)] #![feature(cfg_target_has_atomic)] #![feature(cfg_target_thread_local)] -#![feature(cfg_target_vendor)] +#![cfg_attr(stage0, feature(cfg_target_vendor))] #![feature(char_error_internals)] #![feature(compiler_builtins_lib)] #![feature(concat_idents)] diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 9b4231d8803..ac20a62f117 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -244,9 +244,6 @@ declare_features! ( // rustc internal (active, omit_gdb_pretty_printer_section, "1.5.0", None, None), - // Allows `cfg(target_vendor = "...")`. - (active, cfg_target_vendor, "1.5.0", Some(29718), None), - // Allows attributes on expressions and non-item statements. (active, stmt_expr_attributes, "1.6.0", Some(15701), None), @@ -686,6 +683,8 @@ declare_features! ( (accepted, if_while_or_patterns, "1.33.0", Some(48215), None), // Allows `use x::y;` to search `x` in the current scope. (accepted, uniform_paths, "1.32.0", Some(53130), None), + // Allows `cfg(target_vendor = "...")`. + (accepted, cfg_target_vendor, "1.33.0", Some(29718), None), ); // If you change this, please modify `src/doc/unstable-book` as well. You must @@ -1181,7 +1180,6 @@ pub const BUILTIN_ATTRIBUTES: &[(&str, AttributeType, AttributeGate)] = &[ // cfg(...)'s that are feature gated const GATED_CFGS: &[(&str, &str, fn(&Features) -> bool)] = &[ // (name in cfg, feature, function to check if the feature is enabled) - ("target_vendor", "cfg_target_vendor", cfg_fn!(cfg_target_vendor)), ("target_thread_local", "cfg_target_thread_local", cfg_fn!(cfg_target_thread_local)), ("target_has_atomic", "cfg_target_has_atomic", cfg_fn!(cfg_target_has_atomic)), ("rustdoc", "doc_cfg", cfg_fn!(doc_cfg)), diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index ec96ea06708..2cc80ddea2d 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -23,7 +23,7 @@ html_favicon_url = "https://doc.rust-lang.org/favicon.ico", html_root_url = "https://doc.rust-lang.org/nightly/", test(attr(deny(warnings))))] #![feature(asm)] -#![feature(cfg_target_vendor)] +#![cfg_attr(stage0, feature(cfg_target_vendor))] #![feature(fnbox)] #![cfg_attr(any(unix, target_os = "cloudabi"), feature(libc))] #![feature(nll)] diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs index 5e519951454..7ed7837268d 100644 --- a/src/libunwind/lib.rs +++ b/src/libunwind/lib.rs @@ -1,7 +1,7 @@ #![no_std] #![unstable(feature = "panic_unwind", issue = "32837")] -#![feature(cfg_target_vendor)] +#![cfg_attr(stage0, feature(cfg_target_vendor))] #![feature(link_cfg)] #![feature(nll)] #![feature(staged_api)] diff --git a/src/test/run-pass/cfg/cfg-target-vendor.rs b/src/test/run-pass/cfg/cfg-target-vendor.rs index 01b904874be..7824585162e 100644 --- a/src/test/run-pass/cfg/cfg-target-vendor.rs +++ b/src/test/run-pass/cfg/cfg-target-vendor.rs @@ -1,6 +1,4 @@ // run-pass -#![feature(cfg_target_vendor)] - #[cfg(target_vendor = "unknown")] pub fn main() { } diff --git a/src/test/ui/feature-gates/feature-gate-cfg-target-vendor.rs b/src/test/ui/feature-gates/feature-gate-cfg-target-vendor.rs deleted file mode 100644 index acd310e7e2e..00000000000 --- a/src/test/ui/feature-gates/feature-gate-cfg-target-vendor.rs +++ /dev/null @@ -1,11 +0,0 @@ -#[cfg(target_vendor = "x")] //~ ERROR `cfg(target_vendor)` is experimental -#[cfg_attr(target_vendor = "x", x)] //~ ERROR `cfg(target_vendor)` is experimental -struct Foo(u64, u64); - -#[cfg(not(any(all(target_vendor = "x"))))] //~ ERROR `cfg(target_vendor)` is experimental -fn foo() {} - -fn main() { - cfg!(target_vendor = "x"); - //~^ ERROR `cfg(target_vendor)` is experimental and subject to change -} diff --git a/src/test/ui/feature-gates/feature-gate-cfg-target-vendor.stderr b/src/test/ui/feature-gates/feature-gate-cfg-target-vendor.stderr deleted file mode 100644 index dd514a5d90a..00000000000 --- a/src/test/ui/feature-gates/feature-gate-cfg-target-vendor.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0658]: `cfg(target_vendor)` is experimental and subject to change (see issue #29718) - --> $DIR/feature-gate-cfg-target-vendor.rs:2:12 - | -LL | #[cfg_attr(target_vendor = "x", x)] //~ ERROR `cfg(target_vendor)` is experimental - | ^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(cfg_target_vendor)] to the crate attributes to enable - -error[E0658]: `cfg(target_vendor)` is experimental and subject to change (see issue #29718) - --> $DIR/feature-gate-cfg-target-vendor.rs:1:7 - | -LL | #[cfg(target_vendor = "x")] //~ ERROR `cfg(target_vendor)` is experimental - | ^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(cfg_target_vendor)] to the crate attributes to enable - -error[E0658]: `cfg(target_vendor)` is experimental and subject to change (see issue #29718) - --> $DIR/feature-gate-cfg-target-vendor.rs:5:19 - | -LL | #[cfg(not(any(all(target_vendor = "x"))))] //~ ERROR `cfg(target_vendor)` is experimental - | ^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(cfg_target_vendor)] to the crate attributes to enable - -error[E0658]: `cfg(target_vendor)` is experimental and subject to change (see issue #29718) - --> $DIR/feature-gate-cfg-target-vendor.rs:9:10 - | -LL | cfg!(target_vendor = "x"); - | ^^^^^^^^^^^^^^^^^^^ - | - = help: add #![feature(cfg_target_vendor)] to the crate attributes to enable - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0658`. |
