rust/compiler/rustc_resolve/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
..
late Move has_self field to hir::AssocKind::Fn. 2025-04-14 16:13:04 +10:00
build_reduced_graph.rs Avoid storing the LocalDefId twice 2025-04-11 10:04:27 +00:00
check_unused.rs Move ast::Item::ident into ast::ItemKind. 2025-04-01 14:08:57 +11:00
def_collector.rs Address review comments. 2025-04-01 16:07:23 +11:00
diagnostics.rs Avoid a reverse map that is only used in diagnostics paths 2025-04-11 09:33:38 +00:00
effective_visibilities.rs Move ast::Item::ident into ast::ItemKind. 2025-04-01 14:08:57 +11:00
errors.rs Allow builtin macros to be used more than once. 2025-03-19 14:12:47 +01:00
ident.rs Avoid an empty trait name in impl blocks. 2025-04-09 15:01:14 +10:00
imports.rs Only compute the DefId when a diagnostic is definitely emitted 2025-04-11 10:04:27 +00:00
late.rs Avoid a node_id_to_def_id call by just storing DefIds instead of NodeIds 2025-04-11 10:04:27 +00:00
lib.rs Rollup merge of #139662 - nnethercote:tweak-DefPathData, r=compiler-errors 2025-04-11 21:21:01 +02:00
macros.rs Avoid a node_id_to_def_id call by just storing DefIds instead of NodeIds 2025-04-11 10:04:27 +00:00
rustdoc.rs rustc_resolve: prevent iteration of refids for completeness 2025-03-27 12:39:48 -04:00