aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/tests.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-09-18 02:36:40 +0100
committerGitHub <[email protected]>2019-09-18 02:36:40 +0100
commit630d212525192c714d4fbab398031aa88c49e538 (patch)
tree742e3278b495b3a8827a7ac1628e66aa76948ff8 /crates/ra_hir/src/ty/tests.rs
parent54379ec6f8f82a470a275771e70825634d3d553b (diff)
parent7d15c81a3367bc538470b5f63d61498eef8efdc7 (diff)
Merge #1861
1861: account for impls generated by macros r=matklad a=matklad The code is pretty horrible and is copy-pased from expressions. We really need to find a better way to lower stuff generated by macros. But it gets the job done! I've actually though that we did this ages ago, but obviously we didn't Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r--crates/ra_hir/src/ty/tests.rs17
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]
3001fn processes_impls_generated_by_macros() {
3002 let t = type_at(
3003 r#"
3004//- /main.rs
3005macro_rules! m {
3006 ($ident:ident) => (impl Trait for $ident {})
3007}
3008trait Trait { fn foo(self) -> u128 {} }
3009struct S;
3010m!(S);
3011fn test() { S.foo()<|>; }
3012"#,
3013 );
3014 assert_eq!(t, "u128");
3015}
3016
3000#[ignore] 3017#[ignore]
3001#[test] 3018#[test]
3002fn method_resolution_trait_before_autoref() { 3019fn method_resolution_trait_before_autoref() {