1
Fork 0
rust/compiler/rustc_monomorphize/src
Nicholas Nethercote ce2aa97cd6 Move has_self field to hir::AssocKind::Fn.
`hir::AssocItem` currently has a boolean `fn_has_self_parameter` field,
which is misplaced, because it's only relevant for associated fns, not
for associated consts or types. This commit moves it (and renames it) to
the `AssocKind::Fn` variant, where it belongs.

This requires introducing a new C-style enum, `AssocTag`, which is like
`AssocKind` but without the fields. This is because `AssocKind` values
are passed to various functions like `find_by_ident_and_kind` to
indicate what kind of associated item should be searched for, and having
to specify `has_self` isn't relevant there.

New methods:
- Predicates `AssocItem::is_fn` and `AssocItem::is_method`.
- `AssocItem::as_tag` which converts `AssocItem::kind` to `AssocTag`.

Removed `find_by_name_and_kinds`, which is unused.

`AssocItem::descr` can now distinguish between methods and associated
functions, which slightly improves some error messages.
2025-04-14 16:13:04 +10:00
..
mono_checks Move has_self field to hir::AssocKind::Fn. 2025-04-14 16:13:04 +10:00
partitioning Remove some dead code 2025-03-11 08:41:15 +00:00
collector.rs Remove the use of Rayon iterators 2025-04-10 22:05:06 +02:00
errors.rs Make missing optimized MIR error more informative 2025-04-01 09:25:12 +00:00
lib.rs Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgr 2025-03-12 17:27:43 +00:00
partitioning.rs Fix binding mode problems 2025-02-22 00:13:19 +00:00
util.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00