Skip to content

Commit

Permalink
Use TyCtxt::is_diagnostic_item
Browse files Browse the repository at this point in the history
  • Loading branch information
Zalathar committed Aug 7, 2024
1 parent 29245ec commit 482412c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_pattern_analysis/src/rustc/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ fn write_struct_like<'tcx>(
EnumInfo::Enum { adt_def, variant_index } => {
let variant = adt_def.variant(variant_index);
let adt_did = adt_def.did();
let name = if tcx.get_diagnostic_item(sym::Option) == Some(adt_did)
|| tcx.get_diagnostic_item(sym::Result) == Some(adt_did)
let name = if tcx.is_diagnostic_item(sym::Option, adt_did)
|| tcx.is_diagnostic_item(sym::Result, adt_did)
{
variant.name.to_string()
} else {
Expand Down

0 comments on commit 482412c

Please sign in to comment.