os-rust/compiler/rustc_hir/src
bors aaef5fe497 Auto merge of #119163 - fmease:refactor-ast-trait-bound-modifiers, r=compiler-errors
Refactor AST trait bound modifiers

Instead of having two types to represent trait bound modifiers in the parser / the AST (`parser::ty::BoundModifiers` & `ast::TraitBoundModifier`), only to map one to the other later, just use `parser::ty::BoundModifiers` (moved & renamed to `ast::TraitBoundModifiers`).

The struct type is more extensible and easier to deal with (see [here](https://github.com/rust-lang/rust/pull/119099/files#r1430749981) and [here](https://github.com/rust-lang/rust/pull/119099/files#r1430752116) for context) since it more closely models what it represents: A compound of two kinds of modifiers, constness and polarity. Modeling this as an enum (the now removed `ast::TraitBoundModifier`) meant one had to add a new variant per *combination* of modifier kind, which simply isn't scalable and which lead to a lot of explicit non-DRY matches.

NB: `hir::TraitBoundModifier` being an enum is fine since HIR doesn't need to worry representing invalid modifier kind combinations as those get rejected during AST validation thereby immensely cutting down the number of possibilities.
2023-12-22 02:00:55 +00:00
..
arena.rs Remove unused arena kinds in rustc_hir and rustc_middle. 2023-11-20 15:05:26 +11:00
def.rs Give VariantData::Struct named fields, to clairfy recovered. 2023-12-20 00:07:34 +00:00
def_path_hash_map.rs Use on-disk-hash-table format for DefPathHashMap in hir::definitions. 2021-09-14 13:54:41 +02:00
definitions.rs Replace some instances of FxHashMap/FxHashSet with stable alternatives (mostly in rustc_hir and rustc_ast_lowering) 2023-12-18 21:03:32 +01:00
diagnostic_items.rs Replace some instances of FxHashMap/FxHashSet with stable alternatives (mostly in rustc_hir and rustc_ast_lowering) 2023-12-18 21:03:32 +01:00
hir.rs Auto merge of #119163 - fmease:refactor-ast-trait-bound-modifiers, r=compiler-errors 2023-12-22 02:00:55 +00:00
hir_id.rs Replace no_ord_impl with orderable. 2023-11-22 18:38:17 +11:00
intravisit.rs banish hir::GenericBound::LangItemTrait 2023-12-15 16:17:27 +00:00
lang_items.rs Implement async gen blocks 2023-12-08 17:23:25 +00:00
lib.rs Remove unused feature. 2023-11-20 16:20:45 +11:00
pat_util.rs Replace some instances of FxHashMap/FxHashSet with stable alternatives (mostly in rustc_hir and rustc_ast_lowering) 2023-12-18 21:03:32 +01:00
stable_hash_impls.rs Only compute the crate hash when necessary. 2023-03-08 09:30:22 +11:00
target.rs Fix enforcement of generics for associated items 2023-12-15 16:17:28 +00:00
tests.rs Replace two create_default_session_if_not_set_then uses. 2023-11-02 19:35:04 +11:00
weak_lang_items.rs Rewrite implementation of #[alloc_error_handler] 2022-10-31 16:32:57 +00:00