1 //! Tests for `builtin_derive_macro.rs` from `hir_expand`.
3 use expect_test::expect;
5 use crate::macro_expansion_tests::check;
8 fn test_copy_expand_simple() {
11 //- minicore: derive, copy
19 impl < > core::marker::Copy for Foo< > {}"##]],
24 fn test_copy_expand_in_core() {
25 cov_mark::check!(test_copy_expand_in_core);
28 #[rustc_builtin_macro]
30 #[rustc_builtin_macro]
36 #[rustc_builtin_macro]
38 #[rustc_builtin_macro]
43 impl < > crate ::marker::Copy for Foo< > {}"##]],
48 fn test_copy_expand_with_type_params() {
51 //- minicore: derive, copy
59 impl <T0: core::marker::Copy, T1: core::marker::Copy> core::marker::Copy for Foo<T0, T1> {}"##]],
64 fn test_copy_expand_with_lifetimes() {
65 // We currently just ignore lifetimes
68 //- minicore: derive, copy
70 struct Foo<A, B, 'a, 'b>;
74 struct Foo<A, B, 'a, 'b>;
76 impl <T0: core::marker::Copy, T1: core::marker::Copy> core::marker::Copy for Foo<T0, T1> {}"##]],
81 fn test_clone_expand() {
84 //- minicore: derive, clone
92 impl <T0: core::clone::Clone, T1: core::clone::Clone> core::clone::Clone for Foo<T0, T1> {}"##]],