Stream: t-lang/wg-meta

Topic: Clarification on #52234


Chase Wilson (Mar 11 2020 at 16:55, on Zulip):

@Vadim Petrochenkov I commented on the github issue but didn't want to clog it with discussion, I just don't understand how to actually bring what you said into practice. My setup is something like this:

macro_rules! generate_macro {
    () => {
        #[macro_export]
        macro_rules! new_macro { () => {}; }
    };
}

#[macro_export]
macro_rules! use_generated_macro {
    () => {
        new_macro!();
    };
}

So that triggers the macro_expanded_macro_exports_accessed_by_absolute_paths error, as it should. Problem is, I don't know how to work with/around that limitation

Vadim Petrochenkov (Mar 11 2020 at 18:41, on Zulip):

Problem is, I don't know how to work with/around that limitation

Vadim Petrochenkov (Mar 11 2020 at 18:42, on Zulip):

By referring to new_macro by a relative name.

Vadim Petrochenkov (Mar 11 2020 at 18:42, on Zulip):

In the same crate that defines it.

Vadim Petrochenkov (Mar 11 2020 at 18:43, on Zulip):

(For wg-meta this is probably an off-topic, this conversation can be moved to general, if possible.)

Vadim Petrochenkov (Mar 11 2020 at 18:46, on Zulip):

By referring to new_macro by a relative name in the same crate that defines it.

It may cause some ugliness, but that's the only way to avoid this limitation right now.

Last update: Jun 05 2020 at 22:15UTC