diff options
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r-- | crates/ra_hir_ty/src/tests/macros.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/ra_hir_ty/src/tests/macros.rs b/crates/ra_hir_ty/src/tests/macros.rs index 4f82ff702..ac5485bc9 100644 --- a/crates/ra_hir_ty/src/tests/macros.rs +++ b/crates/ra_hir_ty/src/tests/macros.rs | |||
@@ -643,6 +643,32 @@ mod clone { | |||
643 | } | 643 | } |
644 | 644 | ||
645 | #[test] | 645 | #[test] |
646 | fn infer_derive_clone_in_core() { | ||
647 | let (db, pos) = TestDB::with_position( | ||
648 | r#" | ||
649 | //- /main.rs crate:main deps:core | ||
650 | use core::S; | ||
651 | fn test() { | ||
652 | S.clone()<|>; | ||
653 | } | ||
654 | |||
655 | //- /lib.rs crate:core | ||
656 | #[prelude_import] | ||
657 | use clone::*; | ||
658 | mod clone { | ||
659 | trait Clone { | ||
660 | fn clone(&self) -> Self; | ||
661 | } | ||
662 | } | ||
663 | #[derive(Clone)] | ||
664 | pub struct S; | ||
665 | |||
666 | "#, | ||
667 | ); | ||
668 | assert_eq!("S", type_at_pos(&db, pos)); | ||
669 | } | ||
670 | |||
671 | #[test] | ||
646 | fn infer_derive_clone_with_params() { | 672 | fn infer_derive_clone_with_params() { |
647 | let (db, pos) = TestDB::with_position( | 673 | let (db, pos) = TestDB::with_position( |
648 | r#" | 674 | r#" |