rust/tests/ui/proc-macro/proc-macro-abi.rs

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

32 lines
645 B
Rust
Raw Normal View History

2023-01-19 09:31:50 -06:00
// force-host
// no-prefer-dynamic
#![crate_type = "proc-macro"]
#![allow(warnings)]
extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro]
pub extern "C" fn abi(a: TokenStream) -> TokenStream {
2023-01-07 18:37:22 -06:00
//~^ ERROR proc macro functions may not be `extern "C"`
a
}
#[proc_macro]
pub extern "system" fn abi2(a: TokenStream) -> TokenStream {
2023-01-07 18:37:22 -06:00
//~^ ERROR proc macro functions may not be `extern "system"`
a
}
#[proc_macro]
pub extern fn abi3(a: TokenStream) -> TokenStream {
2023-01-07 18:37:22 -06:00
//~^ ERROR proc macro functions may not be `extern "C"`
a
}
#[proc_macro]
pub extern "Rust" fn abi4(a: TokenStream) -> TokenStream {
a
}