From 7fda874dd4c84d4b53ed625e9eccc92c3fa9a48e Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 11 May 2019 20:31:41 +0200 Subject: Blacklist some traits from being considered in where clauses For Send/Sync/Sized, we don't handle auto traits correctly yet and because they have a lot of impls, they can easily lead to slowdowns. In the case of Fn/FnMut/FnOnce, we don't parse the special Fn notation correctly yet and don't handle closures yet, so we are very unlikely to find an impl. --- crates/ra_hir/src/ty/tests.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir/src/ty/tests.rs') diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 59c85daed..510fa5333 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs @@ -2620,22 +2620,22 @@ fn method_resolution_slow() { let t = type_at( r#" //- /main.rs -trait Send {} +trait SendX {} -struct S1; impl Send for S1; -struct S2; impl Send for S2; +struct S1; impl SendX for S1; +struct S2; impl SendX for S2; struct U1; trait Trait { fn method(self); } struct X1 {} -impl Send for X1 where A: Send, B: Send {} +impl SendX for X1 where A: SendX, B: SendX {} struct S {} -trait Fn {} +trait FnX {} -impl Trait for S where C: Fn, B: Send {} +impl Trait for S where C: FnX, B: SendX {} fn test() { (S {}).method()<|>; } "#, -- cgit v1.2.3