Tracking Issue for future-incompatibility lint `macro_expanded_macro_exports_accessed_by_absolute_paths`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
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 https://github.com/rust-lang/rust/pull/52234#issuecomment-486819782 for more details.
Implementation history
- https://github.com/rust-lang/rust/pull/52234 introduced the restriction as a hard error
- https://github.com/rust-lang/rust/pull/53653 relaxed it to a deny-by-default deprecation lint
- https://github.com/rust-lang/rust/pull/143929 made the lint report-in-deps
- XXX turned the lint into a hard error
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the implementation history in PRs #52234, #53653, and #143929, then use the compile-fail example in this issue to understand the current behavior. The work is done when this future-incompatibility lint becomes a hard error, with the example and relevant compiler behavior updated accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100