Skip to content

Commit 9a53d59

Browse files
committed
fix evaluation of target_feature = "crt-static"
1 parent 4c9896f commit 9a53d59

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/test/ui/proc-macro/crt-static.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
// Test proc-macro crate can be built without additional RUSTFLAGS
22
// on musl target
33
// override -Ctarget-feature=-crt-static from compiletest
4-
// compile-flags: -Ctarget-feature=
4+
// compile-flags: --crate-type proc-macro -Ctarget-feature=
55
// ignore-wasm32
66
// ignore-sgx no support for proc-macro crate type
77
// build-pass
88
#![crate_type = "proc-macro"]
99

10+
// FIXME: This don't work when crate-type is specified by attribute
11+
// `#![crate_type = "proc-macro"]`, not by `--crate-type=proc-macro`
12+
// command line flag. This is beacuse the list of `cfg` symbols is generated
13+
// before attributes are parsed. See rustc_interface::util::add_configuration
14+
#[cfg(target_feature = "crt-static")]
15+
compile_error!("crt-static is enabled");
16+
1017
extern crate proc_macro;
1118

1219
use proc_macro::TokenStream;

0 commit comments

Comments
 (0)