diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-29 16:58:29 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-29 16:58:29 +0000 |
commit | b30de4ed49be362ed8fd71ac367c90554441b079 (patch) | |
tree | 57a73fd5f720d5890b82999fafa897eac70f0749 /crates/ra_hir_ty/src/tests/traits.rs | |
parent | 232785251bc80bc32c2ab52b624ecffbf5e35185 (diff) | |
parent | 8280795a85a9a6d5ec43fea00a023e0b7dc9aaa8 (diff) |
Merge #2679
2679: Resolve traits for infer using lang item infrastructure r=matklad a=kiljacken
As we already have the infrastructure for collecting lang items, use it to find the right traits when doing type-inference.
Co-authored-by: Emil Lauridsen <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/tests/traits.rs')
-rw-r--r-- | crates/ra_hir_ty/src/tests/traits.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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() { | |||
27 | //- /std.rs crate:std | 27 | //- /std.rs crate:std |
28 | #[prelude_import] use future::*; | 28 | #[prelude_import] use future::*; |
29 | mod future { | 29 | mod future { |
30 | #[lang = "future_trait"] | ||
30 | trait Future { | 31 | trait Future { |
31 | type Output; | 32 | type Output; |
32 | } | 33 | } |
@@ -56,6 +57,7 @@ fn test() { | |||
56 | //- /std.rs crate:std | 57 | //- /std.rs crate:std |
57 | #[prelude_import] use future::*; | 58 | #[prelude_import] use future::*; |
58 | mod future { | 59 | mod future { |
60 | #[lang = "future_trait"] | ||
59 | trait Future { | 61 | trait Future { |
60 | type Output; | 62 | type Output; |
61 | } | 63 | } |
@@ -198,6 +200,7 @@ fn test() { | |||
198 | 200 | ||
199 | #[prelude_import] use ops::*; | 201 | #[prelude_import] use ops::*; |
200 | mod ops { | 202 | mod ops { |
203 | #[lang = "neg"] | ||
201 | pub trait Neg { | 204 | pub trait Neg { |
202 | type Output; | 205 | type Output; |
203 | } | 206 | } |
@@ -230,6 +233,7 @@ fn test() { | |||
230 | 233 | ||
231 | #[prelude_import] use ops::*; | 234 | #[prelude_import] use ops::*; |
232 | mod ops { | 235 | mod ops { |
236 | #[lang = "not"] | ||
233 | pub trait Not { | 237 | pub trait Not { |
234 | type Output; | 238 | type Output; |
235 | } | 239 | } |
@@ -506,6 +510,7 @@ fn test() { | |||
506 | 510 | ||
507 | #[prelude_import] use ops::*; | 511 | #[prelude_import] use ops::*; |
508 | mod ops { | 512 | mod ops { |
513 | #[lang = "index"] | ||
509 | pub trait Index<Idx> { | 514 | pub trait Index<Idx> { |
510 | type Output; | 515 | type Output; |
511 | } | 516 | } |