diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-25 12:25:46 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-25 12:25:46 +0000 |
commit | 8d667bb32ed8460988bf9fe3515a6f8318adb8b0 (patch) | |
tree | 5d41d254dc94ff7d8d20063a08df2b9b133d34d9 /crates/ra_hir_ty/src/tests/macros.rs | |
parent | e2dd17f75b1bb5e1185acff66211e74430177592 (diff) | |
parent | 2adc9a8d5f8f7686a125a478330c67a2d46fba98 (diff) |
Merge #3692
3692: Introduce `MacroDefKind::CustomDerive` r=matklad a=edwin0cheng
This PR introduce a new `MacroDefKind` `CustomDerive`. And use a new `ProcMacroExpander` for its expanding. And the expander is a dummy for now.
Related: #3654
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/tests/macros.rs')
-rw-r--r-- | crates/ra_hir_ty/src/tests/macros.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/macros.rs b/crates/ra_hir_ty/src/tests/macros.rs index 2e309a379..eb97288f1 100644 --- a/crates/ra_hir_ty/src/tests/macros.rs +++ b/crates/ra_hir_ty/src/tests/macros.rs | |||
@@ -639,3 +639,22 @@ mod clone { | |||
639 | ); | 639 | ); |
640 | assert_eq!("(Wrapper<S>, {unknown})", type_at_pos(&db, pos)); | 640 | assert_eq!("(Wrapper<S>, {unknown})", type_at_pos(&db, pos)); |
641 | } | 641 | } |
642 | |||
643 | #[test] | ||
644 | fn infer_custom_derive_simple() { | ||
645 | // FIXME: this test current now do nothing | ||
646 | let (db, pos) = TestDB::with_position( | ||
647 | r#" | ||
648 | //- /main.rs crate:main | ||
649 | use foo::Foo; | ||
650 | |||
651 | #[derive(Foo)] | ||
652 | struct S{} | ||
653 | |||
654 | fn test() { | ||
655 | S{}<|>; | ||
656 | } | ||
657 | "#, | ||
658 | ); | ||
659 | assert_eq!("S", type_at_pos(&db, pos)); | ||
660 | } | ||