From 8fad8e897a8d3a5c2e55d3a00fb8465fb87f86bb Mon Sep 17 00:00:00 2001 From: Emil Lauridsen Date: Sun, 29 Dec 2019 17:39:31 +0100 Subject: Resolve traits in infer using lang item infrastructure --- crates/ra_hir_ty/src/tests/simple.rs | 1 + crates/ra_hir_ty/src/tests/traits.rs | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'crates/ra_hir_ty/src/tests') diff --git a/crates/ra_hir_ty/src/tests/simple.rs b/crates/ra_hir_ty/src/tests/simple.rs index 00134c99b..f7e042c12 100644 --- a/crates/ra_hir_ty/src/tests/simple.rs +++ b/crates/ra_hir_ty/src/tests/simple.rs @@ -20,6 +20,7 @@ fn test() { mod prelude {} mod boxed { + #[lang = "owned_box"] pub struct Box { inner: *mut T, } diff --git a/crates/ra_hir_ty/src/tests/traits.rs b/crates/ra_hir_ty/src/tests/traits.rs index 0bc72644a..4b268510c 100644 --- a/crates/ra_hir_ty/src/tests/traits.rs +++ b/crates/ra_hir_ty/src/tests/traits.rs @@ -27,6 +27,7 @@ fn test() { //- /std.rs crate:std #[prelude_import] use future::*; mod future { + #[lang = "future_trait"] trait Future { type Output; } @@ -56,6 +57,7 @@ fn test() { //- /std.rs crate:std #[prelude_import] use future::*; mod future { + #[lang = "future_trait"] trait Future { type Output; } @@ -198,6 +200,7 @@ fn test() { #[prelude_import] use ops::*; mod ops { + #[lang = "neg"] pub trait Neg { type Output; } @@ -230,6 +233,7 @@ fn test() { #[prelude_import] use ops::*; mod ops { + #[lang = "not"] pub trait Not { type Output; } @@ -506,6 +510,7 @@ fn test() { #[prelude_import] use ops::*; mod ops { + #[lang = "index"] pub trait Index { type Output; } -- cgit v1.2.3