diff options
author | Aleksey Kladov <[email protected]> | 2019-09-17 20:22:40 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-09-18 02:34:48 +0100 |
commit | 7d15c81a3367bc538470b5f63d61498eef8efdc7 (patch) | |
tree | 742e3278b495b3a8827a7ac1628e66aa76948ff8 /crates/ra_hir/src/ty | |
parent | 54379ec6f8f82a470a275771e70825634d3d553b (diff) |
account for impls generated by macros
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 09c17fdf4..3b0a99460 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -2997,6 +2997,23 @@ fn foo() { | |||
2997 | ); | 2997 | ); |
2998 | } | 2998 | } |
2999 | 2999 | ||
3000 | #[test] | ||
3001 | fn processes_impls_generated_by_macros() { | ||
3002 | let t = type_at( | ||
3003 | r#" | ||
3004 | //- /main.rs | ||
3005 | macro_rules! m { | ||
3006 | ($ident:ident) => (impl Trait for $ident {}) | ||
3007 | } | ||
3008 | trait Trait { fn foo(self) -> u128 {} } | ||
3009 | struct S; | ||
3010 | m!(S); | ||
3011 | fn test() { S.foo()<|>; } | ||
3012 | "#, | ||
3013 | ); | ||
3014 | assert_eq!(t, "u128"); | ||
3015 | } | ||
3016 | |||
3000 | #[ignore] | 3017 | #[ignore] |
3001 | #[test] | 3018 | #[test] |
3002 | fn method_resolution_trait_before_autoref() { | 3019 | fn method_resolution_trait_before_autoref() { |