02378997ea
in this commit, `naked_asm!` is an alias for `asm!` with one difference: `options(noreturn)` is always enabled by `naked_asm!`. That makes it future-compatible for when `naked_asm!` starts disallowing `options(noreturn)` later.
39 lines
637 B
Rust
39 lines
637 B
Rust
//@ needs-asm-support
|
|
#![feature(naked_functions)]
|
|
#![crate_type = "lib"]
|
|
|
|
use std::arch::naked_asm;
|
|
|
|
#[naked]
|
|
pub unsafe extern "C" fn inline_none() {
|
|
naked_asm!("");
|
|
}
|
|
|
|
#[naked]
|
|
#[inline]
|
|
//~^ ERROR [E0736]
|
|
pub unsafe extern "C" fn inline_hint() {
|
|
naked_asm!("");
|
|
}
|
|
|
|
#[naked]
|
|
#[inline(always)]
|
|
//~^ ERROR [E0736]
|
|
pub unsafe extern "C" fn inline_always() {
|
|
naked_asm!("");
|
|
}
|
|
|
|
#[naked]
|
|
#[inline(never)]
|
|
//~^ ERROR [E0736]
|
|
pub unsafe extern "C" fn inline_never() {
|
|
naked_asm!("");
|
|
}
|
|
|
|
#[naked]
|
|
#[cfg_attr(all(), inline(never))]
|
|
//~^ ERROR [E0736]
|
|
pub unsafe extern "C" fn conditional_inline_never() {
|
|
naked_asm!("");
|
|
}
|