diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-22 05:32:48 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-22 05:32:48 +0000 |
commit | 9c6c6a7cb51b701585827c1a39d36450ddb5cd51 (patch) | |
tree | c5e4c46da389accd0b03b3b285f5057265f65f65 /crates/ra_ide_api/src/completion/complete_struct_literal.rs | |
parent | 51323a852a8979a71c21725b3b2771224132b85f (diff) | |
parent | 1ee779d1f74f48d9f3098001c63108b794dbc0b5 (diff) |
Merge #988
988: Consolidate Ty variants into a new variant Ty::Apply r=matklad a=flodiebold
This gets us a lot closer to Chalk. It also introduces a lot of boilerplate, though, especially when matching :/ A lot of this can probably be refactored to be nicer, though.
Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/completion/complete_struct_literal.rs')
-rw-r--r-- | crates/ra_ide_api/src/completion/complete_struct_literal.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide_api/src/completion/complete_struct_literal.rs b/crates/ra_ide_api/src/completion/complete_struct_literal.rs index 6bef9624e..b75526282 100644 --- a/crates/ra_ide_api/src/completion/complete_struct_literal.rs +++ b/crates/ra_ide_api/src/completion/complete_struct_literal.rs | |||
@@ -1,4 +1,4 @@ | |||
1 | use hir::{Ty, AdtDef}; | 1 | use hir::AdtDef; |
2 | 2 | ||
3 | use crate::completion::{CompletionContext, Completions}; | 3 | use crate::completion::{CompletionContext, Completions}; |
4 | 4 | ||
@@ -15,8 +15,8 @@ pub(super) fn complete_struct_literal(acc: &mut Completions, ctx: &CompletionCon | |||
15 | None => return, | 15 | None => return, |
16 | }; | 16 | }; |
17 | let ty = infer_result[expr].clone(); | 17 | let ty = infer_result[expr].clone(); |
18 | let (adt, substs) = match ty { | 18 | let (adt, substs) = match ty.as_adt() { |
19 | Ty::Adt { def_id, ref substs, .. } => (def_id, substs), | 19 | Some(res) => res, |
20 | _ => return, | 20 | _ => return, |
21 | }; | 21 | }; |
22 | match adt { | 22 | match adt { |