Proc macro not expanding (tokio::main, I guess?)

I've a project (for debugging purposes only) that, as part of a workspace, works fine using tokio::main from another crate. For some reason, if I create a Cargo project out of that workspace I get:

proc macro main not expanded: Proc macros are disabled

This is the entry program:


mod app_ftl;

rialight::initialize!(async move |app| {
    let mut app_ftl = crate::app_ftl::create();
    if !app_ftl.mutable().load(None).await {
    println!("{}", app_ftl.get_message_string("hello-world", None, &mut vec![]).unwrap());

(There's only one error.)

Here's the full debug project:

It uses In particular, rialight/src/

// ...

pub use tokio as __tokio;

macro_rules! initialize {
    ($lambda_exp:expr) => {
        use rialight::__tokio as __rialight_tokio;

        #[__rialight_tokio::main(crate = "__rialight_tokio")]
        async fn main() {
            use std::sync::{Arc};
            use rialight::app::Application;
            include!(concat!(env!("OUT_DIR"), "/"));
            let app = Arc::new(Application {});
            let user_ie: fn(Arc<Application>) -> _ = $lambda_exp;

I also confirmed that relying directly on rialight via:

#rialight = "1"
rialight = { path = "../api/rialight" }

Leads to the same error. Somehow it works with another crate that is shipped with the workspace.

Strange! It happens in the IDE (rust-analyzer), but not when I run it through the command prompt. I tried cargo run and it works.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.