rust/tests/ui/check-cfg/values-target-json.rs
Urgau 3455d66041 Honor current target when checking conditional compilation values
This is fixed by simply using the currently registered target in the
current session. We need to use it because of target json that are not
by design included in the rustc list of targets.
2023-03-09 21:55:00 +01:00

22 lines
576 B
Rust

// This test checks that we don't lint values defined by a custom target (target json)
//
// check-pass
// needs-llvm-components: x86
// compile-flags: --crate-type=lib --check-cfg=values() --target={{src-base}}/check-cfg/my-awesome-platform.json -Z unstable-options
#![feature(lang_items, no_core, auto_traits)]
#![no_core]
#[lang = "sized"]
trait Sized {}
#[cfg(target_os = "linuz")]
//~^ WARNING unexpected `cfg` condition value
fn target_os_linux_misspell() {}
#[cfg(target_os = "linux")]
fn target_os_linux() {}
#[cfg(target_os = "ericos")]
fn target_os_ericos() {}