rust/tests/ui/intrinsics/safe-intrinsic-mismatch.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
600 B
Rust
Raw Normal View History

2022-09-27 00:22:07 -05:00
#![feature(intrinsics)]
#![feature(rustc_attrs)]
extern "rust-intrinsic" {
fn size_of<T>() -> usize; //~ ERROR intrinsic safety mismatch
//~^ ERROR intrinsic safety mismatch
2022-09-27 00:22:07 -05:00
}
#[rustc_intrinsic]
const fn assume(_b: bool) {} //~ ERROR intrinsic safety mismatch
//~| ERROR intrinsic has wrong type
2024-02-02 09:07:10 -06:00
#[rustc_intrinsic]
const fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {}
//~^ ERROR intrinsic safety mismatch
//~| ERROR intrinsic has wrong type
mod foo {
#[rustc_intrinsic]
unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {}
}
2022-09-27 00:22:07 -05:00
fn main() {}