rust/tests/ui/check-cfg/values-target-json.rs
Urgau 4c1671674e Avoid target_os and target_arch in some check-cfg tests
as they unnecessarily clutter the diagnostic output and make the
experience of adding a new target to the compiler more painful than
it should be.

target_os and target_arch are still being tested in the
well-known-values.rs test, but in one place.
2023-12-09 11:59:46 +01:00

18 lines
465 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=cfg() --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 = "linux")]
fn target_os_linux() {}
#[cfg(target_os = "ericos")]
fn target_os_ericos() {}