Skip to content

Tracking Issue for future-incompatibility lint macro_expanded_macro_exports_accessed_by_absolute_paths #144408

@petrochenkov

Description

@petrochenkov

The macro_expanded_macro_exports_accessed_by_absolute_paths lint
detects macro-expanded macro_export macros from the current crate
that cannot be referred to by absolute paths.

Example

macro_rules! define_exported {
    () => {
        #[macro_export]
        macro_rules! exported {
            () => {};
        }
    };
}

define_exported!();

fn main() {
    crate::exported!();
}

Explanation

The intent is that all macros marked with the #[macro_export]
attribute are made available in the root of the crate. However, when a
macro_rules! definition is generated by another macro, the macro
expansion is unable to uphold this rule.
See #52234 (comment) for more details.

Implementation history

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-future-incompatibilityCategory: Future-incompatibility lintsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions