Cannot Compile with Custom Inner Attributes

⚓ Rust    📅 2025-06-24    👤 surdeus    👁️ 7      

surdeus

Warning

This post was published 48 days ago. The information described in this article may have changed.

Hi, I am trying to use a procedural macro as a custom inner attribute, I have added this code to the top of main.rs, my crate root-

#![feature(custom_inner_attributes)]
#![my_macro_crate::my_macro]
// my code
...

I am getting 4 errors with cargo +nightly run.

error: expected square brackets
--> src/main.rs:1:1
error: #[panic_handler] function required but not found
error: main function not found

So, I definitely have a main function, I am just wondering what else I need to do to get this to compile correctly so I can use custom inner attributes.

Can someone help me get this working or point me to a guide that does this?

1 post - 1 participant

Read full topic

🏷️ rust_feed