We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
TyCtxt::is_diagnostic_item
1 parent b4e567f commit 9969b1dCopy full SHA for 9969b1d
compiler/rustc_pattern_analysis/src/rustc/print.rs
@@ -114,8 +114,8 @@ fn write_struct_like<'tcx>(
114
EnumInfo::Enum { adt_def, variant_index } => {
115
let variant = adt_def.variant(variant_index);
116
let adt_did = adt_def.did();
117
- let name = if tcx.get_diagnostic_item(sym::Option) == Some(adt_did)
118
- || 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)
119
{
120
variant.name.to_string()
121
} else {
0 commit comments