18 releases

0.9.0 Apr 16, 2026
0.8.1 Jul 12, 2025
0.8.0 Apr 7, 2025
0.7.1 Sep 5, 2024
0.1.0 Jul 5, 2020

#1078 in Procedural macros

Download history 1862/week @ 2026-01-22 1554/week @ 2026-01-29 1694/week @ 2026-02-05 1859/week @ 2026-02-12 2095/week @ 2026-02-19 3411/week @ 2026-02-26 3128/week @ 2026-03-05 2328/week @ 2026-03-12 2423/week @ 2026-03-19 1875/week @ 2026-03-26 2897/week @ 2026-04-02 3540/week @ 2026-04-09 3758/week @ 2026-04-16 3441/week @ 2026-04-23 2494/week @ 2026-04-30 3661/week @ 2026-05-07

13,829 downloads per month
Used in 8 crates (via extendr-api)

MIT license

82KB
1.5K SLoC

extendr-macros

A procedural macro crate for extendr-api.

This crate implements macros such as the #[extendr] function markup and the extendr_module! macro. See extendr-api for more details.

For Developers

This crate uses trybuild for testing procedural macros. Trybuild compiles test cases in tests/cases/ and tests/extendr_impl/ and verifies that the compiler produces expected error messages for invalid code.

Running Tests

To run the trybuild tests:

cargo test --package extendr-macros --test trybuild

Updating Expected Outputs

When you intentionally change error messages or add new test cases, you need to update the expected output files (.stderr files). Use the TRYBUILD=overwrite environment variable to automatically update them:

TRYBUILD=overwrite cargo test --package extendr-macros --test trybuild

This will regenerate the .stderr files in the tests/cases/ directory to match the current compiler output.

Dependencies

~110–465KB
~11K SLoC