diff options
author | Aleksey Kladov <[email protected]> | 2020-04-07 15:40:39 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-04-07 15:40:39 +0100 |
commit | 3bde2b742388f3ec3bb08841f93a06a62be04e4d (patch) | |
tree | 32da4e54e9e9e82b69cc1456cc0eb11b840af384 | |
parent | 5540193fc87a33a6c141956a63f9f56fe6207ee8 (diff) |
A more precise panic macro
-rw-r--r-- | crates/ra_ide/src/completion/complete_record.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_ide/src/completion/complete_record.rs b/crates/ra_ide/src/completion/complete_record.rs index 780a98aea..79f5c8c8f 100644 --- a/crates/ra_ide/src/completion/complete_record.rs +++ b/crates/ra_ide/src/completion/complete_record.rs | |||
@@ -7,7 +7,7 @@ pub(super) fn complete_record(acc: &mut Completions, ctx: &CompletionContext) -> | |||
7 | let (ty, variant, already_present_fields) = | 7 | let (ty, variant, already_present_fields) = |
8 | match (ctx.record_lit_pat.as_ref(), ctx.record_lit_syntax.as_ref()) { | 8 | match (ctx.record_lit_pat.as_ref(), ctx.record_lit_syntax.as_ref()) { |
9 | (None, None) => return None, | 9 | (None, None) => return None, |
10 | (Some(_), Some(_)) => panic!("A record cannot be both a literal and a pattern"), | 10 | (Some(_), Some(_)) => unreachable!("A record cannot be both a literal and a pattern"), |
11 | (Some(record_pat), _) => ( | 11 | (Some(record_pat), _) => ( |
12 | ctx.sema.type_of_pat(&record_pat.clone().into())?, | 12 | ctx.sema.type_of_pat(&record_pat.clone().into())?, |
13 | ctx.sema.resolve_record_pattern(record_pat)?, | 13 | ctx.sema.resolve_record_pattern(record_pat)?, |