Skip to content

Commit dc4d655

Browse files
authored
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`.
2 parents 361c4ea + 3dd0a7d commit dc4d655

File tree

1 file changed

+2
-2
lines changed
  • compiler/rustc_save_analysis/src

1 file changed

+2
-2
lines changed

compiler/rustc_save_analysis/src/sig.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// references.
2222
//
2323
// Signatures do not include visibility info. I'm not sure if this is a feature
24-
// or an ommission (FIXME).
24+
// or an omission (FIXME).
2525
//
2626
// FIXME where clauses need implementing, defs/refs in generics are mostly missing.
2727

@@ -677,7 +677,7 @@ impl<'hir> Sig for hir::Variant<'hir> {
677677
let mut text = self.ident.to_string();
678678
match self.data {
679679
hir::VariantData::Struct(fields, r) => {
680-
let id = parent_id.unwrap();
680+
let id = parent_id.ok_or("Missing id for Variant's parent")?;
681681
let name_def = SigElement {
682682
id: id_from_hir_id(id, scx),
683683
start: offset,

0 commit comments

Comments
 (0)