rust/compiler/rustc_ast_lowering/src
Guillaume Gomez 27dc222fb4
Rollup merge of #136901 - workingjubilee:stabilize-externabi-hashing-forever, r=compiler-errors
compiler: give `ExternAbi` truly stable `Hash` and `Ord`

Currently, `ExternAbi` has a bunch of code to handle the reality that, as an enum, adding more variants to it will risk it hashing differently. It forces all of those variants to be added in a fixed order, except this means that the order of the variants doesn't correspond to any logical order except "historical accident". This is all to avoid having to rebless two tests. Perhaps there were more, once upon a time? But then we invented normalization in our test suite to handle exactly this sort of issue in a more general way.

There are two options here:
- Get rid of all the logical overhead and shrug, embracing blessing a couple of tests sometimes
- Change `ExternAbi` to have an ordering and hash that doesn't depend on the number of variants

As `ExternAbi` is essentially a strongly-typed string, and thus no two strings can be identical, this implements the second of the two by hand-implementing `Ord` and `Hash` to make the hashing and comparison based on the string! This will diff the current hashes, but they will diff no more after this.
2025-02-12 20:30:55 +01:00
..
asm.rs show supported register classes 2025-01-29 12:15:12 +01:00
block.rs (Re-)Implement impl_trait_in_bindings 2024-12-14 03:21:24 +00:00
delegation.rs compiler: remove rustc_target::spec::abi reexports 2025-02-09 20:45:47 -08:00
errors.rs Rollup merge of #136239 - folkertdev:show-supported-register-classes, r=SparrowLii,jieyouxu 2025-02-11 18:04:34 +01:00
expr.rs Don't ICE when failing to lower contracts for associated impl items 2025-02-10 21:38:31 +00:00
format.rs Rustfmt 2025-02-08 22:12:13 +00:00
index.rs Use a different hir type for patterns in pattern types than we use in match patterns 2025-02-03 08:18:30 +00:00
item.rs compiler: remove rustc_abi::lookup and AbiUnsupported 2025-02-11 20:18:01 -08:00
lib.rs Auto merge of #136851 - jhpratt:rollup-ftijn95, r=jhpratt 2025-02-11 10:17:02 +00:00
pat.rs Add a TyPat in the AST to reuse the generic arg lowering logic 2025-02-11 08:51:05 +00:00
path.rs tree-wide: parallel: Fully removed all Lrc, replaced with Arc 2025-02-03 13:25:57 +03:00
stability.rs compiler: remove AbiDatas 2025-02-11 20:18:01 -08:00