Skip to content

Commit

Permalink
peace of mind: remove a call to Option::expect
Browse files Browse the repository at this point in the history
  • Loading branch information
dianne committed Feb 5, 2025
1 parent a5cc4cb commit 060cc37
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/rustc_mir_build/src/thir/pattern/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ pub(super) fn pat_from_hir<'a, 'tcx>(
};
let result = pcx.lower_pattern(pat);
debug!("pat_from_hir({:?}) = {:?}", pat, result);
if let Some(info) = migration_info {
let sugg = pcx.rust_2024_migration_suggestion.expect("suggestion should be present");
if let Some(info) = migration_info
&& let Some(sugg) = pcx.rust_2024_migration_suggestion
{
let mut spans =
MultiSpan::from_spans(info.primary_labels.iter().map(|(span, _)| *span).collect());
for (span, label) in &info.primary_labels {
Expand Down

0 comments on commit 060cc37

Please sign in to comment.