mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-04 11:17:04 +00:00

As before, add `MetaSized` and `PointeeSized` traits to all of the non-minicore `no_core` tests so that they don't fail for lack of language items.
22 lines
718 B
Rust
22 lines
718 B
Rust
//! Ensure "forbidden" target features are not exposed via `cfg`.
|
|
//@ compile-flags: --target=riscv32e-unknown-none-elf --crate-type=lib
|
|
//@ needs-llvm-components: riscv
|
|
//@ check-pass
|
|
#![feature(no_core, lang_items)]
|
|
#![no_core]
|
|
#![allow(unexpected_cfgs)]
|
|
|
|
#[lang = "pointee_sized"]
|
|
pub trait PointeeSized {}
|
|
|
|
#[lang = "meta_sized"]
|
|
pub trait MetaSized: PointeeSized {}
|
|
|
|
#[lang = "sized"]
|
|
pub trait Sized: MetaSized {}
|
|
|
|
// 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.
|
|
#[cfg(target_feature = "forced-atomics")]
|
|
compile_error!("the forced-atomics feature should not be exposed in `cfg`");
|