diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-13 11:37:32 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-13 11:37:32 +0000 |
commit | 1f897d1c6eaa7f0251bb47a5d2d1894cd8e82d54 (patch) | |
tree | 87c4f024bfd4308e4ab6a7068102808efec888b6 /crates/ra_hir/src | |
parent | 6f2cab1368dafc5663bb591a45062280a94a4ef9 (diff) | |
parent | e4f4cd77a07918529cd274f3299a020cbc884974 (diff) |
Merge #3120
3120: Support trait auto import r=matklad a=SomeoneToIgnore
Unfortunately, for real cases it does not work as spectacular as in the tests.
The main reason for that is type inference:
* The callee type [here](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir_ty/src/method_resolution.rs#L369) is unknown for many cases
* The trait solution [here](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_hir_ty/src/method_resolution.rs#L399) is also often ambiguous
That results in trait candidates being rejected, and some real cases not supported.
Example: no imports for `String::from_str("test")`
Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 4fb679f6d..a56b8ab04 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -818,7 +818,7 @@ impl TypeParam { | |||
818 | } | 818 | } |
819 | } | 819 | } |
820 | 820 | ||
821 | // FIXME: rename to `ImplBlock` | 821 | // FIXME: rename from `ImplBlock` to `Impl` |
822 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 822 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
823 | pub struct ImplBlock { | 823 | pub struct ImplBlock { |
824 | pub(crate) id: ImplId, | 824 | pub(crate) id: ImplId, |