diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-10-27 09:51:49 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-10-27 09:51:49 +0000 |
commit | 8cfc1cd95b6eb9c94f037cfe866c92d51c58c930 (patch) | |
tree | e539dcb18229e328628720661c50d928a72afea1 /crates/hir/src | |
parent | 7f346f9ae17ff9ebaeb24e5bfc4aa56f6ec13191 (diff) | |
parent | ae6376d74cf354a71a83d8c1dcc93589acbce6ea (diff) |
Merge #6376
6376: Avoid impls_fnonce to return true when the trait solving is ambiguous r=flodiebold a=GrayJack
This PR should fix #6375
This adds a variation of `method_resolution::implements_trait` called `method_resolution::implements_trait_unique`, that only returns true when the trait solving is unique, and also change `impls_fnonce` to use the later instead.
I also added a test just to be sure.
Co-authored-by: GrayJack <[email protected]>
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/code_model.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 63c1a8ebf..563145f92 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs | |||
@@ -1398,7 +1398,7 @@ impl Type { | |||
1398 | }; | 1398 | }; |
1399 | 1399 | ||
1400 | let canonical_ty = Canonical { value: self.ty.value.clone(), kinds: Arc::new([]) }; | 1400 | let canonical_ty = Canonical { value: self.ty.value.clone(), kinds: Arc::new([]) }; |
1401 | method_resolution::implements_trait( | 1401 | method_resolution::implements_trait_unique( |
1402 | &canonical_ty, | 1402 | &canonical_ty, |
1403 | db, | 1403 | db, |
1404 | self.ty.environment.clone(), | 1404 | self.ty.environment.clone(), |