Auto merge of #83599 - jyn514:unorderable, r=Aaron1011
Auto merge of #83599 - jyn514:unorderable, r=Aaron1011

Avoid sorting by DefId for `necessary_variants()`

Follow-up to https://github.com/rust-lang/rust/pull/83074. Originally I tried removing `impl Ord for DefId` but that hit *lots* of errors :sweat_smile: so I thought I would start with easy things.

I am not sure whether this could actually cause invalid query results, but this is used from `MarkSymbolVisitor::visit_arm` so it's at least feasible.

r? `@Aaron1011`

graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,graydon/rust