#diagnostics #macro #rome #registry #compile-time #codebase #build

rome_diagnostics_categories

Diagnostic categories for rome_diagnostics. It exposes a macro that emits compile-time errors for extranous categories.

1 unstable release

0.0.1 Apr 4, 2023

#13 in #rome

Download history 9/week @ 2023-12-13 15/week @ 2023-12-20 6/week @ 2023-12-27 4/week @ 2024-01-03 16/week @ 2024-01-10 6/week @ 2024-01-17 1/week @ 2024-01-24 2/week @ 2024-01-31 10/week @ 2024-02-07 28/week @ 2024-02-14 25/week @ 2024-02-21 36/week @ 2024-02-28 33/week @ 2024-03-06 30/week @ 2024-03-13 35/week @ 2024-03-20 32/week @ 2024-03-27

132 downloads per month
Used in 10 crates (2 directly)

MIT license

24KB
344 lines

rome_diagnostics_categories

This crate contains a static registry of all the diagnostic categories used throughout the Rome codebase

Code Generation

The list of categories is defined in src/categories.rs using the define_dategories! macro, but instead of relying on conventional Rust macro expansion this crate instead uses a build script (in build.rs) to control how the code resulting from the macro is generated.

Specifically this lets us generate new identifiers, which is something plain Rust macros cannot do, without having to use full-blown procedural macros, which would require creating and building yet another crate.

Dependencies

~20–345KB