-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
C-tracking-issueCategory: Tracking IssueCategory: Tracking Issue
Description
A new function tcx.get_diagnostic_name
is available (after the next sync) and we should migrate existing code to use it in any case that multiple queries can be reduced to one.
For example (this is just one of a few different patterns that can be refactored):
// before
cx.tcx.is_diagnostic_item(sym::Vec, def_id)
|| cx.tcx.is_diagnostic_item(sym::HashMap, def_id)
|| cx.tcx.is_diagnostic_item(sym::HashSet, def_id)
// after
matches!(cx.tcx.get_diagnostic_name(def_id), Some(sym::Vec | sym::HashMap | sym::HashSet))
Also look for type_is_diagnotic_item
calls which can be refactored using ty.ty_adt_def()?.did
.
xFrednet
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: Tracking IssueCategory: Tracking Issue
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
match_def_path
and friends withis_item
#7647