rust/compiler/rustc_resolve/src
Josh Triplett 63cfb3af37 mbe: Defer checks for compile_error! until reporting an unused macro rule
The MBE parser checks rules at initial parse time to see if their RHS
has `compile_error!` in it, and returns a list of rule indexes and LHS
spans that don't map to `compile_error!`, for use in unused macro rule
checking.

Instead, have the unused macro rule reporting ask the macro for the rule
to report, and let the macro check at that time. That avoids checking
rules unless they're unused.

In the process, refactor the data structure used to store macro rules,
to group the LHS and RHS (and LHS span) of each rule together, and
refactor the unused rule tracking to only track rule indexes.

This ends up being a net simplification, and reduction in code size.
2025-07-05 16:23:13 -07:00
..
late Replace kw_span by full span. 2025-07-03 14:59:27 +00:00
rustdoc Update tests to work with new DocFragment field and redundant_explicit_links new API 2025-06-23 16:02:34 +02:00
build_reduced_graph.rs mbe: Defer checks for compile_error! until reporting an unused macro rule 2025-07-05 16:23:13 -07:00
check_unused.rs deduplicate more walk_* methods in AST visit 2025-06-06 04:59:26 +00:00
def_collector.rs Don't give APITs names with macro expansion placeholder fragments in it 2025-06-25 15:42:11 +00:00
diagnostics.rs Port #[non_exhaustive] to the new attribute parsing infrastructure 2025-07-04 20:30:42 +02:00
effective_visibilities.rs Reorder ast::ItemKind::{Struct,Enum,Union} fields. 2025-05-28 15:48:45 +10:00
errors.rs Rollup merge of #134006 - klensy:typos, r=nnethercote 2025-07-03 13:29:35 +02:00
ident.rs Detect when attribute is provided by missing derive macro 2025-06-12 21:28:49 +00:00
imports.rs explain ImportData::imported_module 2025-06-29 00:23:35 +08:00
late.rs Rollup merge of #143380 - cjgillot:kw_span, r=compiler-errors 2025-07-04 05:47:27 +02:00
lib.rs mbe: Defer checks for compile_error! until reporting an unused macro rule 2025-07-05 16:23:13 -07:00
macros.rs mbe: Defer checks for compile_error! until reporting an unused macro rule 2025-07-05 16:23:13 -07:00
rustdoc.rs setup CI and tidy to use typos for spellchecking and fix few typos 2025-07-03 10:51:06 +03:00