rust/tests/ui/proc-macro/derive-test.rs

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

23 lines
342 B
Rust
Raw Normal View History

//@ run-pass
//@ no-prefer-dynamic
2016-11-17 15:41:20 +00:00
//@ compile-flags: --test
#![crate_type = "proc-macro"]
extern crate proc_macro;
use proc_macro::TokenStream;
// ```
// assert!(true);
// ```
#[proc_macro_derive(Foo)]
pub fn derive_foo(_input: TokenStream) -> TokenStream {
2016-11-17 15:41:20 +00:00
"".parse().unwrap()
}
#[test]
pub fn test_derive() {
assert!(true);
}