rust/tests/ui/proc-macro/crt-static.rs

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

28 lines
873 B
Rust
Raw Normal View History

2020-08-02 10:20:00 -05:00
// Test proc-macro crate can be built without additional RUSTFLAGS
// on musl target
2020-03-08 08:49:52 -05:00
// override -Ctarget-feature=-crt-static from compiletest
// compile-flags: --crate-type proc-macro -Ctarget-feature=
2020-03-16 20:57:11 -05:00
// ignore-wasm32
2020-05-05 20:12:50 -05:00
// ignore-sgx no support for proc-macro crate type
2020-03-03 05:17:24 -06:00
// build-pass
// force-host
// no-prefer-dynamic
#![crate_type = "proc-macro"]
// FIXME: This don't work when crate-type is specified by attribute
// `#![crate_type = "proc-macro"]`, not by `--crate-type=proc-macro`
// command line flag. This is because the list of `cfg` symbols is generated
// before attributes are parsed. See rustc_interface::util::add_configuration
#[cfg(target_feature = "crt-static")]
compile_error!("crt-static is enabled");
extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro_derive(Foo)]
pub fn derive_foo(input: TokenStream) -> TokenStream {
input
}