aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/tests.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-05-11 19:31:41 +0100
committerFlorian Diebold <[email protected]>2019-05-12 19:23:57 +0100
commit7fda874dd4c84d4b53ed625e9eccc92c3fa9a48e (patch)
tree104eccdcdc745f6d15dcf9173996815c807a7287 /crates/ra_hir/src/ty/tests.rs
parentc8b85891b0c6c03a1b373491f75b8872ec47e06f (diff)
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.
Diffstat (limited to 'crates/ra_hir/src/ty/tests.rs')
-rw-r--r--crates/ra_hir/src/ty/tests.rs12
1 files changed, 6 insertions, 6 deletions
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() {
2620 let t = type_at( 2620 let t = type_at(
2621 r#" 2621 r#"
2622//- /main.rs 2622//- /main.rs
2623trait Send {} 2623trait SendX {}
2624 2624
2625struct S1; impl Send for S1; 2625struct S1; impl SendX for S1;
2626struct S2; impl Send for S2; 2626struct S2; impl SendX for S2;
2627struct U1; 2627struct U1;
2628 2628
2629trait Trait { fn method(self); } 2629trait Trait { fn method(self); }
2630 2630
2631struct X1<A, B> {} 2631struct X1<A, B> {}
2632impl<A, B> Send for X1<A, B> where A: Send, B: Send {} 2632impl<A, B> SendX for X1<A, B> where A: SendX, B: SendX {}
2633 2633
2634struct S<B, C> {} 2634struct S<B, C> {}
2635 2635
2636trait Fn {} 2636trait FnX {}
2637 2637
2638impl<B, C> Trait for S<B, C> where C: Fn, B: Send {} 2638impl<B, C> Trait for S<B, C> where C: FnX, B: SendX {}
2639 2639
2640fn test() { (S {}).method()<|>; } 2640fn test() { (S {}).method()<|>; }
2641"#, 2641"#,