diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-10-25 20:41:28 +0900 |
|---|---|---|
| committer | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-10-25 20:52:33 +0900 |
| commit | 3dd0a7d6eba173e5169b66fd4417025916aa0f3e (patch) | |
| tree | 07c8d9f8d542e1a610d0b03c7dc4bda6aa74f844 | |
| parent | f58ffc93815f76576eb56df4bdeec2fe8f12b766 (diff) | |
| download | rust-3dd0a7d6eba173e5169b66fd4417025916aa0f3e.tar.gz rust-3dd0a7d6eba173e5169b66fd4417025916aa0f3e.zip | |
Do not call `unwrap` with `signatures` option enabled
| -rw-r--r-- | compiler/rustc_save_analysis/src/sig.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_save_analysis/src/sig.rs b/compiler/rustc_save_analysis/src/sig.rs index 747e198cd93..446a0723d8c 100644 --- a/compiler/rustc_save_analysis/src/sig.rs +++ b/compiler/rustc_save_analysis/src/sig.rs @@ -21,7 +21,7 @@ // references. // // Signatures do not include visibility info. I'm not sure if this is a feature -// or an ommission (FIXME). +// or an omission (FIXME). // // FIXME where clauses need implementing, defs/refs in generics are mostly missing. @@ -677,7 +677,7 @@ impl<'hir> Sig for hir::Variant<'hir> { let mut text = self.ident.to_string(); match self.data { hir::VariantData::Struct(fields, r) => { - let id = parent_id.unwrap(); + let id = parent_id.ok_or("Missing id for Variant's parent")?; let name_def = SigElement { id: id_from_hir_id(id, scx), start: offset, |
