mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rollup merge of #155126 - folkertdev:target-object-format, r=Urgau
add `cfg(target_object_format = "...")` tracking issue: https://github.com/rust-lang/rust/issues/152586 I'm implementing the predicate as `target_object_format`, because that's what is useful to me (for testing `#[link_section = "..."]` where `mach-o` has some extra restrictions) and maps cleanly to the `BinaryFormat` enum that is used internally. There is still room for a future `target_executable_format` when there is a use case. cc @joshtriplett as the lang sponsor of this feature, @workingjubilee as the author of the proposal. r? JonathanBrouwer a sidequest from the sidequest that is https://github.com/rust-lang/rust/pull/155065
This commit is contained in:
@@ -52,6 +52,8 @@
|
||||
use rustc_index::{Idx, IndexSlice, IndexVec};
|
||||
#[cfg(feature = "nightly")]
|
||||
use rustc_macros::{Decodable_NoContext, Encodable_NoContext, HashStable_Generic};
|
||||
#[cfg(feature = "nightly")]
|
||||
use rustc_span::{Symbol, sym};
|
||||
|
||||
mod callconv;
|
||||
mod canon_abi;
|
||||
@@ -770,6 +772,14 @@ pub fn as_str(&self) -> &'static str {
|
||||
Self::Big => "big",
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "nightly")]
|
||||
pub fn desc_symbol(&self) -> Symbol {
|
||||
match self {
|
||||
Self::Little => sym::little,
|
||||
Self::Big => sym::big,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Endian {
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
sym::cfg_target_has_reliable_f16_f128,
|
||||
Features::cfg_target_has_reliable_f16_f128,
|
||||
),
|
||||
(sym::target_object_format, sym::cfg_target_object_format, Features::cfg_target_object_format),
|
||||
];
|
||||
|
||||
/// Find a gated cfg determined by the `pred`icate which is given the cfg's name.
|
||||
|
||||
@@ -410,6 +410,8 @@ pub fn internal(&self, feature: Symbol) -> bool {
|
||||
(unstable, cfg_target_has_atomic, "1.60.0", Some(94039)),
|
||||
/// Allows `cfg(target_has_atomic_equal_alignment = "...")`.
|
||||
(unstable, cfg_target_has_atomic_equal_alignment, "1.60.0", Some(93822)),
|
||||
/// Allows `cfg(target_object_format = "...")`.
|
||||
(unstable, cfg_target_object_format, "CURRENT_RUSTC_VERSION", Some(152586)),
|
||||
/// Allows `cfg(target_thread_local)`.
|
||||
(unstable, cfg_target_thread_local, "1.7.0", Some(29594)),
|
||||
/// Allows the use of `#[cfg(ub_checks)` to check if UB checks are enabled.
|
||||
|
||||
@@ -144,6 +144,7 @@ pub(crate) fn disallow_cfgs(sess: &Session, user_cfgs: &Cfg) {
|
||||
| (sym::target_endian, Some(_))
|
||||
| (sym::target_env, None | Some(_))
|
||||
| (sym::target_family, Some(_))
|
||||
| (sym::target_object_format, Some(_))
|
||||
| (sym::target_os, Some(_))
|
||||
| (sym::target_pointer_width, Some(_))
|
||||
| (sym::target_vendor, None | Some(_))
|
||||
@@ -252,8 +253,9 @@ macro_rules! ins_sym {
|
||||
|
||||
ins_sym!(sym::target_abi, sess.target.cfg_abi.desc_symbol());
|
||||
ins_sym!(sym::target_arch, sess.target.arch.desc_symbol());
|
||||
ins_str!(sym::target_endian, sess.target.endian.as_str());
|
||||
ins_sym!(sym::target_endian, sess.target.endian.desc_symbol());
|
||||
ins_sym!(sym::target_env, sess.target.env.desc_symbol());
|
||||
ins_sym!(sym::target_object_format, sess.target.options.binary_format.desc_symbol());
|
||||
|
||||
for family in sess.target.families.as_ref() {
|
||||
ins_str!(sym::target_family, family);
|
||||
@@ -420,12 +422,13 @@ macro_rules! ins {
|
||||
|
||||
// sym::target_*
|
||||
{
|
||||
const VALUES: [&Symbol; 8] = [
|
||||
const VALUES: [&Symbol; 9] = [
|
||||
&sym::target_abi,
|
||||
&sym::target_arch,
|
||||
&sym::target_endian,
|
||||
&sym::target_env,
|
||||
&sym::target_family,
|
||||
&sym::target_object_format,
|
||||
&sym::target_os,
|
||||
&sym::target_pointer_width,
|
||||
&sym::target_vendor,
|
||||
@@ -449,6 +452,7 @@ macro_rules! ins {
|
||||
Some(values_target_endian),
|
||||
Some(values_target_env),
|
||||
Some(values_target_family),
|
||||
Some(values_target_object_format),
|
||||
Some(values_target_os),
|
||||
Some(values_target_pointer_width),
|
||||
Some(values_target_vendor),
|
||||
@@ -460,11 +464,12 @@ macro_rules! ins {
|
||||
for target in Target::builtins().chain(iter::once(current_target.clone())) {
|
||||
values_target_abi.insert(target.options.cfg_abi.desc_symbol());
|
||||
values_target_arch.insert(target.arch.desc_symbol());
|
||||
values_target_endian.insert(Symbol::intern(target.options.endian.as_str()));
|
||||
values_target_endian.insert(target.options.endian.desc_symbol());
|
||||
values_target_env.insert(target.options.env.desc_symbol());
|
||||
values_target_family.extend(
|
||||
target.options.families.iter().map(|family| Symbol::intern(family)),
|
||||
);
|
||||
values_target_object_format.insert(target.options.binary_format.desc_symbol());
|
||||
values_target_os.insert(target.options.os.desc_symbol());
|
||||
values_target_pointer_width.insert(sym::integer(target.pointer_width));
|
||||
values_target_vendor.insert(target.vendor_symbol());
|
||||
|
||||
@@ -589,6 +589,7 @@
|
||||
cfg_target_has_atomic,
|
||||
cfg_target_has_atomic_equal_alignment,
|
||||
cfg_target_has_reliable_f16_f128,
|
||||
cfg_target_object_format,
|
||||
cfg_target_thread_local,
|
||||
cfg_target_vendor,
|
||||
cfg_trace: "<cfg_trace>", // must not be a valid identifier
|
||||
@@ -623,6 +624,7 @@
|
||||
coerce_pointee_validated,
|
||||
coerce_shared,
|
||||
coerce_unsized,
|
||||
coff,
|
||||
cold,
|
||||
cold_path,
|
||||
collapse_debuginfo,
|
||||
@@ -853,6 +855,7 @@
|
||||
eii_internals,
|
||||
eii_shared_macro,
|
||||
element_ty,
|
||||
elf,
|
||||
// Notes about `sym::empty`:
|
||||
// - It should only be used when it genuinely means "empty symbol". Use
|
||||
// `Option<Symbol>` when "no symbol" is a possibility.
|
||||
@@ -1167,6 +1170,7 @@
|
||||
linkonce_odr,
|
||||
lint_reasons,
|
||||
literal,
|
||||
little, big,
|
||||
load,
|
||||
loaded_from_disk,
|
||||
local,
|
||||
@@ -1193,6 +1197,7 @@
|
||||
lt,
|
||||
m68k,
|
||||
m68k_target_feature,
|
||||
macho: "mach-o",
|
||||
macro_at_most_once_rep,
|
||||
macro_attr,
|
||||
macro_attributes_in_derive_output,
|
||||
@@ -2014,6 +2019,7 @@
|
||||
target_has_reliable_f16_math,
|
||||
target_has_reliable_f128,
|
||||
target_has_reliable_f128_math,
|
||||
target_object_format,
|
||||
target_os,
|
||||
target_pointer_width,
|
||||
target_thread_local,
|
||||
@@ -2237,6 +2243,7 @@
|
||||
vtable_size,
|
||||
warn,
|
||||
wasip2,
|
||||
wasm,
|
||||
wasm32,
|
||||
wasm64,
|
||||
wasm_abi,
|
||||
@@ -2271,6 +2278,7 @@
|
||||
x86_amx_intrinsics,
|
||||
x87_reg,
|
||||
x87_target_feature,
|
||||
xcoff,
|
||||
xer,
|
||||
xmm_reg,
|
||||
xop_target_feature,
|
||||
|
||||
@@ -1395,6 +1395,16 @@ pub fn to_object(&self) -> object::BinaryFormat {
|
||||
Self::Xcoff => object::BinaryFormat::Xcoff,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn desc_symbol(&self) -> Symbol {
|
||||
match self {
|
||||
Self::Coff => sym::coff,
|
||||
Self::Elf => sym::elf,
|
||||
Self::MachO => sym::macho,
|
||||
Self::Wasm => sym::wasm,
|
||||
Self::Xcoff => sym::xcoff,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToJson for Align {
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# `cfg_target_object_format`
|
||||
|
||||
The tracking issue for this feature is: [#152586]
|
||||
|
||||
[#152586]: https://github.com/rust-lang/rust/issues/152586
|
||||
|
||||
------------------------
|
||||
|
||||
The `cfg_target_object_format` feature makes it possible to execute different code
|
||||
depending on the current target's object file format.
|
||||
|
||||
## Examples
|
||||
|
||||
```rust
|
||||
#![feature(cfg_target_object_format)]
|
||||
|
||||
#[cfg(target_object_format = "elf")]
|
||||
fn a() {
|
||||
// ...
|
||||
}
|
||||
|
||||
#[cfg(target_object_format = "mach-o")]
|
||||
fn a() {
|
||||
// ...
|
||||
}
|
||||
|
||||
fn b() {
|
||||
if cfg!(target_object_format = "wasm") {
|
||||
// ...
|
||||
} else {
|
||||
// ...
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -423,6 +423,13 @@ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
(sym::unix, None) => "Unix",
|
||||
(sym::windows, None) => "Windows",
|
||||
(sym::debug_assertions, None) => "debug-assertions enabled",
|
||||
(sym::target_object_format, Some(format)) => match self.1 {
|
||||
Format::LongHtml => {
|
||||
return write!(fmt, "object format <code>{format}</code>");
|
||||
}
|
||||
Format::LongPlain => return write!(fmt, "object format `{format}`"),
|
||||
Format::ShortHtml => return write!(fmt, "<code>{format}</code>"),
|
||||
},
|
||||
(sym::target_os, Some(os)) => human_readable_target_os(*os).unwrap_or_default(),
|
||||
(sym::target_arch, Some(arch)) => {
|
||||
human_readable_target_arch(*arch).unwrap_or_default()
|
||||
|
||||
@@ -187,6 +187,12 @@ macro_rules! stringify {
|
||||
};
|
||||
}
|
||||
|
||||
#[rustc_builtin_macro]
|
||||
#[macro_export]
|
||||
macro_rules! compile_error {
|
||||
($msg:expr $(,)?) => {{ /* compiler built-in */ }};
|
||||
}
|
||||
|
||||
#[lang = "add"]
|
||||
pub trait Add<Rhs = Self> {
|
||||
type Output;
|
||||
|
||||
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `foo`
|
||||
LL | #[doc(cfg(foo), cfg(bar))]
|
||||
| ^^^
|
||||
|
|
||||
= help: expected names are: `FALSE` and `test` and 31 more
|
||||
= help: expected names are: `FALSE` and `test` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(foo)`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
//@ add-minicore
|
||||
//@ check-pass
|
||||
//@ ignore-backends: gcc
|
||||
//
|
||||
//@ revisions: linux_gnu linux_musl linux_ohos linux_powerpc
|
||||
//@[linux_gnu] compile-flags: --target aarch64-unknown-linux-gnu
|
||||
//@[linux_gnu] needs-llvm-components: aarch64
|
||||
//@[linux_musl] compile-flags: --target aarch64-unknown-linux-musl
|
||||
//@[linux_musl] needs-llvm-components: aarch64
|
||||
//@[linux_ohos] compile-flags: --target aarch64-unknown-linux-ohos
|
||||
//@[linux_ohos] needs-llvm-components: aarch64
|
||||
//@[linux_powerpc] compile-flags: --target powerpc-unknown-linux-gnu
|
||||
//@[linux_powerpc] needs-llvm-components: powerpc
|
||||
//
|
||||
//@ revisions: darwin ios
|
||||
//@[darwin] compile-flags: --target aarch64-apple-darwin
|
||||
//@[darwin] needs-llvm-components: aarch64
|
||||
//@[ios] compile-flags: --target aarch64-apple-ios
|
||||
//@[ios] needs-llvm-components: aarch64
|
||||
//
|
||||
//@ revisions: win_msvc win_gnu
|
||||
//@[win_msvc] compile-flags: --target aarch64-pc-windows-msvc
|
||||
//@[win_msvc] needs-llvm-components: aarch64
|
||||
//@[win_gnu] compile-flags: --target x86_64-pc-windows-gnu
|
||||
//@[win_gnu] needs-llvm-components: x86
|
||||
//
|
||||
//@ revisions: wasm32 wasm64
|
||||
//@[wasm32] compile-flags: --target wasm32-unknown-unknown
|
||||
//@[wasm32] needs-llvm-components: webassembly
|
||||
//@[wasm64] compile-flags: --target wasm64-unknown-unknown
|
||||
//@[wasm64] needs-llvm-components: webassembly
|
||||
//
|
||||
//@ revisions: aix
|
||||
//@[aix] compile-flags: --target powerpc64-ibm-aix
|
||||
//@[aix] needs-llvm-components: powerpc
|
||||
//
|
||||
//@ revisions: hermit sgx uefi
|
||||
//@[hermit] compile-flags: --target x86_64-unknown-hermit
|
||||
//@[hermit] needs-llvm-components: x86
|
||||
//@[sgx] compile-flags: --target x86_64-fortanix-unknown-sgx
|
||||
//@[sgx] needs-llvm-components: x86
|
||||
//@[uefi] compile-flags: --target x86_64-unknown-uefi
|
||||
//@[uefi] needs-llvm-components: x86
|
||||
//
|
||||
//@ revisions: bpfeb bpfel
|
||||
//@[bpfeb] compile-flags: --target bpfeb-unknown-none
|
||||
//@[bpfeb] needs-llvm-components: bpf
|
||||
//@[bpfel] compile-flags: --target bpfel-unknown-none
|
||||
//@[bpfel] needs-llvm-components: bpf
|
||||
//
|
||||
//@ revisions: avr
|
||||
//@[avr] compile-flags: --target avr-none -Ctarget-cpu=atmega328
|
||||
//@[avr] needs-llvm-components: avr
|
||||
//
|
||||
//@ revisions: msp430
|
||||
//@[msp430] compile-flags: --target msp430-none-elf
|
||||
//@[msp430] needs-llvm-components: msp430
|
||||
//
|
||||
//@ revisions: thumb
|
||||
//@[thumb] compile-flags: --target thumbv7m-none-eabi
|
||||
//@[thumb] needs-llvm-components: arm
|
||||
#![crate_type = "lib"]
|
||||
#![feature(no_core, lang_items, cfg_target_object_format)]
|
||||
#![no_core]
|
||||
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
macro_rules! assert_cfg {
|
||||
($rhs:ident = $rhs_val:literal) => {
|
||||
#[cfg(not($rhs = $rhs_val))]
|
||||
compile_error!(concat!("expected `", stringify!($rhs), " = ", $rhs_val, "`",));
|
||||
};
|
||||
}
|
||||
|
||||
const _: () = {
|
||||
cfg_select!(
|
||||
target_os = "linux" => assert_cfg!(target_object_format = "elf"),
|
||||
target_os = "aix" => assert_cfg!(target_object_format = "xcoff"),
|
||||
target_os = "uefi" => assert_cfg!(target_object_format = "coff"),
|
||||
target_os = "windows" => assert_cfg!(target_object_format = "coff"),
|
||||
target_os = "hermit" => assert_cfg!(target_object_format = "elf"),
|
||||
|
||||
target_arch = "bpf" => assert_cfg!(target_object_format = "elf"),
|
||||
target_arch = "avr" => assert_cfg!(target_object_format = "elf"),
|
||||
target_arch = "msp430" => assert_cfg!(target_object_format = "elf"),
|
||||
|
||||
target_abi = "eabi" => assert_cfg!(target_object_format = "elf"),
|
||||
target_vendor = "apple" => assert_cfg!(target_object_format = "mach-o"),
|
||||
target_family = "wasm" => assert_cfg!(target_object_format = "wasm"),
|
||||
|
||||
windows => assert_cfg!(target_object_format = "coff"),
|
||||
|
||||
_ => {}
|
||||
);
|
||||
};
|
||||
|
||||
const _: () = {
|
||||
cfg_select!(
|
||||
target_object_format = "mach-o" => assert_cfg!(target_vendor = "apple"),
|
||||
target_object_format = "wasm" => assert_cfg!(target_family = "wasm"),
|
||||
target_object_format = "xcoff" => assert_cfg!(target_os = "aix"),
|
||||
_ => {}
|
||||
);
|
||||
};
|
||||
@@ -3,9 +3,9 @@
|
||||
//@ revisions: sanitizer_cfi_generalize_pointers_ sanitizer_cfi_normalize_integers_
|
||||
//@ revisions: proc_macro_ panic_ target_feature_ unix_ windows_ target_abi_
|
||||
//@ revisions: target_arch_ target_endian_ target_env_ target_family_ target_os_
|
||||
//@ revisions: target_pointer_width_ target_vendor_ target_has_atomic_
|
||||
//@ revisions: target_has_atomic_equal_alignment_ target_has_atomic_load_store_
|
||||
//@ revisions: target_thread_local_ relocation_model_
|
||||
//@ revisions: target_object_format_ target_pointer_width_ target_vendor_
|
||||
//@ revisions: target_has_atomic_ target_has_atomic_equal_alignment_
|
||||
//@ revisions: target_has_atomic_load_store_ target_thread_local_ relocation_model_
|
||||
//@ revisions: fmt_debug_
|
||||
//@ revisions: emscripten_wasm_eh_
|
||||
//@ revisions: reliable_f16_ reliable_f16_math_ reliable_f128_ reliable_f128_math_
|
||||
@@ -26,6 +26,7 @@
|
||||
//@ [target_endian_]compile-flags: --cfg target_endian="little"
|
||||
//@ [target_env_]compile-flags: --cfg target_env
|
||||
//@ [target_family_]compile-flags: --cfg target_family="unix"
|
||||
//@ [target_object_format_]compile-flags: --cfg target_object_format="elf"
|
||||
//@ [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
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
error: unexpected `--cfg target_object_format="elf"` flag
|
||||
|
|
||||
= note: config `target_object_format` is only supposed to be controlled by `--target`
|
||||
= note: manually setting a built-in cfg can and does create incoherent behaviors
|
||||
= note: `#[deny(explicit_builtin_cfgs_in_flags)]` on by default
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `has_foo`
|
||||
LL | #[cfg(has_foo)]
|
||||
| ^^^^^^^
|
||||
|
|
||||
= help: expected names are: `has_bar` and 31 more
|
||||
= help: expected names are: `has_bar` and 32 more
|
||||
= help: consider using a Cargo feature instead
|
||||
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
|
||||
[lints.rust]
|
||||
|
||||
@@ -25,7 +25,7 @@ warning: unexpected `cfg` condition name: `tokio_unstable`
|
||||
LL | #[cfg(tokio_unstable)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: expected names are: `docsrs`, `feature`, and `test` and 31 more
|
||||
= help: expected names are: `docsrs`, `feature`, and `test` and 32 more
|
||||
= help: consider using a Cargo feature instead
|
||||
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
|
||||
[lints.rust]
|
||||
|
||||
@@ -25,7 +25,7 @@ warning: unexpected `cfg` condition name: `tokio_unstable`
|
||||
LL | #[cfg(tokio_unstable)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: expected names are: `CONFIG_NVME`, `docsrs`, `feature`, and `test` and 31 more
|
||||
= help: expected names are: `CONFIG_NVME`, `docsrs`, `feature`, and `test` and 32 more
|
||||
= help: consider using a Cargo feature instead
|
||||
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
|
||||
[lints.rust]
|
||||
|
||||
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `invalid_cfg1`
|
||||
LL | invalid_cfg1 => {}
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= help: expected names are: `FALSE` and `test` and 31 more
|
||||
= help: expected names are: `FALSE` and `test` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(invalid_cfg1)`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `value`
|
||||
LL | #[cfg(value)]
|
||||
| ^^^^^
|
||||
|
|
||||
= help: expected names are: `bar`, `bee`, `cow`, and `foo` and 31 more
|
||||
= help: expected names are: `bar`, `bee`, `cow`, and `foo` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(value)`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `my_value`
|
||||
LL | #[cfg(my_value)]
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= help: expected names are: `bar` and `foo` and 31 more
|
||||
= help: expected names are: `bar` and `foo` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(my_value)`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `unknown_key`
|
||||
LL | #[cfg(unknown_key = "value")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: expected names are: `feature` and 31 more
|
||||
= help: expected names are: `feature` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `unknown_key`
|
||||
LL | #[cfg(unknown_key = "value")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: expected names are: `feature` and 31 more
|
||||
= help: expected names are: `feature` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(unknown_key, values("value"))`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `b`
|
||||
LL | for<#[cfg(b)] c> u8:;
|
||||
| ^ help: found config with similar value: `target_feature = "b"`
|
||||
|
|
||||
= help: expected names are: `FALSE`, `docsrs`, and `test` and 31 more
|
||||
= help: expected names are: `FALSE`, `docsrs`, and `test` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(b)`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
@@ -44,7 +44,7 @@ warning: unexpected `cfg` condition name: `uu`
|
||||
LL | #[cfg_attr(uu, unix)]
|
||||
| ^^
|
||||
|
|
||||
= help: expected names are: `feature` and 31 more
|
||||
= help: expected names are: `feature` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(uu)`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `unknown`
|
||||
LL | #[cfg(unknown)]
|
||||
| ^^^^^^^
|
||||
|
|
||||
= help: expected names are: `FALSE` and `test` and 31 more
|
||||
= help: expected names are: `FALSE` and `test` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(unknown)`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
@@ -14,7 +14,7 @@ warning: unexpected `cfg` condition name: `r#false`
|
||||
LL | #[cfg(r#false)]
|
||||
| ^^^^^^^
|
||||
|
|
||||
= help: expected names are: `async`, `edition2015`, `edition2021`, and `r#true` and 31 more
|
||||
= help: expected names are: `async`, `edition2015`, `edition2021`, and `r#true` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(r#false)`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ warning: unexpected `cfg` condition name: `r#false`
|
||||
LL | #[cfg(r#false)]
|
||||
| ^^^^^^^
|
||||
|
|
||||
= help: expected names are: `r#async`, `edition2015`, `edition2021`, and `r#true` and 31 more
|
||||
= help: expected names are: `r#async`, `edition2015`, `edition2021`, and `r#true` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(r#false)`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `my_lib_cfg`
|
||||
LL | cfg_macro::my_lib_macro!();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: expected names are: `feature` and 31 more
|
||||
= help: expected names are: `feature` and 32 more
|
||||
= note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate
|
||||
= help: try referring to `cfg_macro::my_lib_macro` crate for guidance on how handle this unexpected cfg
|
||||
= help: the macro `cfg_macro::my_lib_macro` may come from an old version of the `cfg_macro` crate, try updating your dependency with `cargo update -p cfg_macro`
|
||||
|
||||
@@ -4,7 +4,7 @@ warning: unexpected `cfg` condition name: `my_lib_cfg`
|
||||
LL | cfg_macro::my_lib_macro!();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: expected names are: `feature` and 31 more
|
||||
= help: expected names are: `feature` and 32 more
|
||||
= note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate
|
||||
= help: try referring to `cfg_macro::my_lib_macro` crate for guidance on how handle this unexpected cfg
|
||||
= help: to expect this configuration use `--check-cfg=cfg(my_lib_cfg)`
|
||||
|
||||
@@ -28,6 +28,7 @@ LL | #[cfg(list_all_well_known_cfgs)]
|
||||
`target_has_atomic`
|
||||
`target_has_atomic_equal_alignment`
|
||||
`target_has_atomic_load_store`
|
||||
`target_object_format`
|
||||
`target_os`
|
||||
`target_pointer_width`
|
||||
`target_thread_local`
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#![feature(cfg_target_has_atomic)]
|
||||
#![feature(cfg_target_has_atomic_equal_alignment)]
|
||||
#![feature(cfg_target_thread_local)]
|
||||
#![feature(cfg_target_object_format)]
|
||||
#![feature(cfg_ub_checks)]
|
||||
#![feature(fmt_debug)]
|
||||
|
||||
@@ -68,6 +69,8 @@
|
||||
//~^ WARN unexpected `cfg` condition value
|
||||
target_has_atomic_load_store = "_UNEXPECTED_VALUE",
|
||||
//~^ WARN unexpected `cfg` condition value
|
||||
target_object_format = "_UNEXPECTED_VALUE",
|
||||
//~^ WARN unexpected `cfg` condition value
|
||||
target_os = "_UNEXPECTED_VALUE",
|
||||
//~^ WARN unexpected `cfg` condition value
|
||||
target_pointer_width = "_UNEXPECTED_VALUE",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:29:5
|
||||
--> $DIR/well-known-values.rs:30:5
|
||||
|
|
||||
LL | clippy = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^----------------------
|
||||
@@ -11,7 +11,7 @@ LL | clippy = "_UNEXPECTED_VALUE",
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:31:5
|
||||
--> $DIR/well-known-values.rs:32:5
|
||||
|
|
||||
LL | debug_assertions = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^----------------------
|
||||
@@ -22,7 +22,7 @@ LL | debug_assertions = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:33:5
|
||||
--> $DIR/well-known-values.rs:34:5
|
||||
|
|
||||
LL | doc = "_UNEXPECTED_VALUE",
|
||||
| ^^^----------------------
|
||||
@@ -33,7 +33,7 @@ LL | doc = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:35:5
|
||||
--> $DIR/well-known-values.rs:36:5
|
||||
|
|
||||
LL | doctest = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^----------------------
|
||||
@@ -44,7 +44,7 @@ LL | doctest = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:37:5
|
||||
--> $DIR/well-known-values.rs:38:5
|
||||
|
|
||||
LL | fmt_debug = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -53,7 +53,7 @@ LL | fmt_debug = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:39:5
|
||||
--> $DIR/well-known-values.rs:40:5
|
||||
|
|
||||
LL | miri = "_UNEXPECTED_VALUE",
|
||||
| ^^^^----------------------
|
||||
@@ -64,7 +64,7 @@ LL | miri = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:41:5
|
||||
--> $DIR/well-known-values.rs:42:5
|
||||
|
|
||||
LL | overflow_checks = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^----------------------
|
||||
@@ -75,7 +75,7 @@ LL | overflow_checks = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:43:5
|
||||
--> $DIR/well-known-values.rs:44:5
|
||||
|
|
||||
LL | panic = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -84,7 +84,7 @@ LL | panic = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:45:5
|
||||
--> $DIR/well-known-values.rs:46:5
|
||||
|
|
||||
LL | proc_macro = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^----------------------
|
||||
@@ -95,7 +95,7 @@ LL | proc_macro = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:47:5
|
||||
--> $DIR/well-known-values.rs:48:5
|
||||
|
|
||||
LL | relocation_model = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -104,7 +104,7 @@ LL | relocation_model = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:49:5
|
||||
--> $DIR/well-known-values.rs:50:5
|
||||
|
|
||||
LL | rustfmt = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^----------------------
|
||||
@@ -115,7 +115,7 @@ LL | rustfmt = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:51:5
|
||||
--> $DIR/well-known-values.rs:52:5
|
||||
|
|
||||
LL | sanitize = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -124,7 +124,7 @@ LL | sanitize = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:53:5
|
||||
--> $DIR/well-known-values.rs:54:5
|
||||
|
|
||||
LL | target_abi = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -133,7 +133,7 @@ LL | target_abi = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:55:5
|
||||
--> $DIR/well-known-values.rs:56:5
|
||||
|
|
||||
LL | target_arch = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -142,7 +142,7 @@ LL | target_arch = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:57:5
|
||||
--> $DIR/well-known-values.rs:58:5
|
||||
|
|
||||
LL | target_endian = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -151,7 +151,7 @@ LL | target_endian = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:59:5
|
||||
--> $DIR/well-known-values.rs:60:5
|
||||
|
|
||||
LL | target_env = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -160,7 +160,7 @@ LL | target_env = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:61:5
|
||||
--> $DIR/well-known-values.rs:62:5
|
||||
|
|
||||
LL | target_family = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -169,7 +169,7 @@ LL | target_family = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:65:5
|
||||
--> $DIR/well-known-values.rs:66:5
|
||||
|
|
||||
LL | target_has_atomic = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -178,7 +178,7 @@ LL | target_has_atomic = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:67:5
|
||||
--> $DIR/well-known-values.rs:68:5
|
||||
|
|
||||
LL | target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -187,7 +187,7 @@ LL | target_has_atomic_equal_alignment = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:69:5
|
||||
--> $DIR/well-known-values.rs:70:5
|
||||
|
|
||||
LL | target_has_atomic_load_store = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -196,7 +196,16 @@ LL | target_has_atomic_load_store = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:71:5
|
||||
--> $DIR/well-known-values.rs:72:5
|
||||
|
|
||||
LL | target_object_format = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: expected values for `target_object_format` are: `coff`, `elf`, `mach-o`, `wasm`, and `xcoff`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:74:5
|
||||
|
|
||||
LL | target_os = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -205,7 +214,7 @@ LL | target_os = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:73:5
|
||||
--> $DIR/well-known-values.rs:76:5
|
||||
|
|
||||
LL | target_pointer_width = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -214,7 +223,7 @@ LL | target_pointer_width = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:75:5
|
||||
--> $DIR/well-known-values.rs:78:5
|
||||
|
|
||||
LL | target_thread_local = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^----------------------
|
||||
@@ -225,7 +234,7 @@ LL | target_thread_local = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:77:5
|
||||
--> $DIR/well-known-values.rs:80:5
|
||||
|
|
||||
LL | target_vendor = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -234,7 +243,7 @@ LL | target_vendor = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:79:5
|
||||
--> $DIR/well-known-values.rs:82:5
|
||||
|
|
||||
LL | ub_checks = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^^^----------------------
|
||||
@@ -245,7 +254,7 @@ LL | ub_checks = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:81:5
|
||||
--> $DIR/well-known-values.rs:84:5
|
||||
|
|
||||
LL | unix = "_UNEXPECTED_VALUE",
|
||||
| ^^^^----------------------
|
||||
@@ -256,7 +265,7 @@ LL | unix = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
|
||||
--> $DIR/well-known-values.rs:83:5
|
||||
--> $DIR/well-known-values.rs:86:5
|
||||
|
|
||||
LL | windows = "_UNEXPECTED_VALUE",
|
||||
| ^^^^^^^----------------------
|
||||
@@ -267,7 +276,7 @@ LL | windows = "_UNEXPECTED_VALUE",
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: unexpected `cfg` condition value: `linuz`
|
||||
--> $DIR/well-known-values.rs:89:7
|
||||
--> $DIR/well-known-values.rs:92:7
|
||||
|
|
||||
LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
|
||||
| ^^^^^^^^^^^^-------
|
||||
@@ -277,5 +286,5 @@ LL | #[cfg(target_os = "linuz")] // testing that we suggest `linux`
|
||||
= note: expected values for `target_os` are: `aix`, `amdhsa`, `android`, `cuda`, `cygwin`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `helenos`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `lynxos178`, `macos`, `managarm`, `motor`, `netbsd`, `none`, `nto`, `nuttx`, `openbsd`, `psp`, `psx`, `qurt`, `redox`, `rtems`, `solaris`, `solid_asp3`, `teeos`, `trusty`, `tvos`, `uefi`, `unknown`, `vexos`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, `windows`, `xous`, and `zkvm`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
|
||||
warning: 28 warnings emitted
|
||||
warning: 29 warnings emitted
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#[allow(unused)]
|
||||
#[cfg(target_object_format = "elf")]
|
||||
//~^ ERROR `cfg(target_object_format)` is experimental
|
||||
const X: () = ();
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,13 @@
|
||||
error[E0658]: `cfg(target_object_format)` is experimental and subject to change
|
||||
--> $DIR/feature-gate-cfg_target_object_format.rs:2:7
|
||||
|
|
||||
LL | #[cfg(target_object_format = "elf")]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: see issue #152586 <https://github.com/rust-lang/rust/issues/152586> for more information
|
||||
= help: add `#![feature(cfg_target_object_format)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
@@ -38,7 +38,7 @@ warning: unexpected `cfg` condition name: `foo`
|
||||
LL | cfg!(foo);
|
||||
| ^^^
|
||||
|
|
||||
= help: expected names are: `FALSE` and `test` and 31 more
|
||||
= help: expected names are: `FALSE` and `test` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(foo)`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
@@ -101,7 +101,7 @@ warning: unexpected `cfg` condition name: `a`
|
||||
LL | a + 1 => {}
|
||||
| ^ help: found config with similar value: `target_feature = "a"`
|
||||
|
|
||||
= help: expected names are: `FALSE` and `test` and 31 more
|
||||
= help: expected names are: `FALSE` and `test` and 32 more
|
||||
= help: to expect this configuration use `--check-cfg=cfg(a)`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
|
||||
Reference in New Issue
Block a user