Skip to content

Imports/reexports of built-in macros are not supported #61687

Description

@petrochenkov
use column; // error: cannot import a built-in macro

fn main() {}

The reason behind this error is that if you import something with a DefId, that DefId should be supported by all stages of compilation (metadata emitting specifically), but built-in macros don't have such a DefId.

The crate ID in their DefId has special value CrateNum::BuiltinMacros that is supported only inside rustc_resolve and causes ICEs every time it leaves it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-resolveArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions