aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty')
-rw-r--r--crates/ra_hir_ty/src/tests/macros.rs26
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]
646fn infer_derive_clone_in_core() {
647 let (db, pos) = TestDB::with_position(
648 r#"
649//- /main.rs crate:main deps:core
650use core::S;
651fn test() {
652 S.clone()<|>;
653}
654
655//- /lib.rs crate:core
656#[prelude_import]
657use clone::*;
658mod clone {
659 trait Clone {
660 fn clone(&self) -> Self;
661 }
662}
663#[derive(Clone)]
664pub struct S;
665
666"#,
667 );
668 assert_eq!("S", type_at_pos(&db, pos));
669}
670
671#[test]
646fn infer_derive_clone_with_params() { 672fn infer_derive_clone_with_params() {
647 let (db, pos) = TestDB::with_position( 673 let (db, pos) = TestDB::with_position(
648 r#" 674 r#"