Skip to content

Macro reexporting broken in 0.1.24 & 0.1.25 #241

Closed
@bearcage

Description

@bearcage

The changes from this diff and released in 0.1.24 and the subsequent 0.1.25 (which, incidentally, looks to be available on crates.io but not reflected in the commit history pushed to github for ctor/Cargo.toml) refer to ctor as a top level module in the macro callsites which deduplicated the big cfg_attr blocks. This, unfortunately, results in errors that look like the attached screenshot if you have reexported the ctor attribute macro in a crate of your own.

Specifically, this happens because crates which depend on ctor by another name, or only transitively (as in my use case) will not have ::ctor available. The usual workaround for this of reexporting dependency macros from your own crate (::config::premain_support::ctor in my case) doesn't work if the reexported macro generates references to itself by name. For not-so-procedural macros, $crate is available to work around this. There might be a general answer for this for procedural macros, but I'm not aware of one -- I'll take a quick look and see what I can find, though.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions