2025-01-27 18:18:13 +01:00
|
|
|
//! Ensure "forbidden" target features are not exposed via `cfg`.
|
|
|
|
|
//@ compile-flags: --target=riscv32e-unknown-none-elf --crate-type=lib
|
|
|
|
|
//@ needs-llvm-components: riscv
|
2024-09-02 11:45:59 +02:00
|
|
|
//@ check-pass
|
|
|
|
|
#![feature(no_core, lang_items)]
|
|
|
|
|
#![no_core]
|
|
|
|
|
#![allow(unexpected_cfgs)]
|
|
|
|
|
|
2025-01-23 11:25:12 +00:00
|
|
|
#[lang = "pointee_sized"]
|
|
|
|
|
pub trait PointeeSized {}
|
|
|
|
|
|
|
|
|
|
#[lang = "meta_sized"]
|
|
|
|
|
pub trait MetaSized: PointeeSized {}
|
|
|
|
|
|
2024-09-02 11:45:59 +02:00
|
|
|
#[lang = "sized"]
|
2025-01-23 11:25:12 +00:00
|
|
|
pub trait Sized: MetaSized {}
|
2024-09-02 11:45:59 +02:00
|
|
|
|
|
|
|
|
// The compile_error macro does not exist, so if the `cfg` evaluates to `true` this
|
|
|
|
|
// complains about the missing macro rather than showing the error... but that's good enough.
|
2025-01-27 18:18:13 +01:00
|
|
|
#[cfg(target_feature = "forced-atomics")]
|
|
|
|
|
compile_error!("the forced-atomics feature should not be exposed in `cfg`");
|