1 //! Tests for user-defined procedural macros.
3 //! Note `//- proc_macros: identity` fixture metas in tests -- we don't use real
4 //! proc-macros here, as that would be slow. Instead, we use several hard-coded
6 use expect_test::expect;
8 use crate::macro_expansion_tests::check;
11 fn attribute_macro_attr_censoring() {
12 cov_mark::check!(attribute_macro_attr_censoring);
15 //- proc_macros: identity
16 #[attr1] #[proc_macros::identity] #[attr2]
20 #[attr1] #[proc_macros::identity] #[attr2]
24 #[attr2] struct S;"##]],
29 fn derive_censoring() {
30 cov_mark::check!(derive_censoring);
33 //- proc_macros: derive_identity
36 #[derive(proc_macros::DeriveIdentity)]
44 #[derive(proc_macros::DeriveIdentity)]
51 #[attr2] struct S;"##]],