Skip to content

Commit

Permalink
Do not call unwrap with signatures option enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Oct 25, 2020
1 parent f58ffc9 commit 3dd0a7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_save_analysis/src/sig.rs
Expand Up @@ -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.

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3dd0a7d

Please sign in to comment.