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]
34 #[rustc_builtin_macro]
39 impl < > crate ::marker::Copy for Foo< > {}"##]],
44 fn test_copy_expand_with_type_params() {
47 //- minicore: derive, copy
55 impl <T0: core::marker::Copy, T1: core::marker::Copy> core::marker::Copy for Foo<T0, T1> {}"##]],
60 fn test_copy_expand_with_lifetimes() {
61 // We currently just ignore lifetimes
64 //- minicore: derive, copy
66 struct Foo<A, B, 'a, 'b>;
70 struct Foo<A, B, 'a, 'b>;
72 impl <T0: core::marker::Copy, T1: core::marker::Copy> core::marker::Copy for Foo<T0, T1> {}"##]],
77 fn test_clone_expand() {
80 //- minicore: derive, clone
88 impl <T0: core::clone::Clone, T1: core::clone::Clone> core::clone::Clone for Foo<T0, T1> {}"##]],