diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-11-15 03:02:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-15 03:02:34 +0100 |
| commit | dc4d65579cd0ae6d92e207bb19682d0a2426706d (patch) | |
| tree | 64ba718022d7b580bb902cfb76b6049186d57867 /compiler/rustc_save_analysis | |
| parent | 361c4ea22486557ec50c4fc6a93d60e7476ecbea (diff) | |
| parent | 3dd0a7d6eba173e5169b66fd4417025916aa0f3e (diff) | |
| download | rust-dc4d65579cd0ae6d92e207bb19682d0a2426706d.tar.gz rust-dc4d65579cd0ae6d92e207bb19682d0a2426706d.zip | |
Rollup merge of #78352 - JohnTitor:issue-75229, r=Dylan-DPC
Do not call `unwrap` with `signatures` option enabled Fixes #75229 Didn't add a test since I couldn't set `RUST_SAVE_ANALYSIS_CONFIG` even with `rustc-env`.
Diffstat (limited to 'compiler/rustc_save_analysis')
| -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 1bf8160e4c3..2f82d0546ba 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, |
