- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)Area: Declarative macros 2.0 (#39412)C-bugCategory: This is a bug.Category: This is a bug.F-decl_macro`#![feature(decl_macro)]``#![feature(decl_macro)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I tried this code:
rust/library/core/src/ptr/mod.rs
Lines 1487 to 1492 in 8cc82ee
| #[unstable(feature = "raw_ref_macros", issue = "73394")] | |
| #[rustc_macro_transparency = "semitransparent"] | |
| #[allow_internal_unstable(raw_ref_op)] | |
| pub macro raw_const($e:expr) { | |
| &raw const $e | |
| } | 
I expected to see this happen: tcx.hir().parent_module(raw_const_hir_id) and tcx.parent(raw_const_def_id).unwrap() are both the module core::ptr.
Instead, this happened: tcx.hir().parent_module(raw_const_hir_id) is core and tcx.parent(raw_const_def_id).unwrap() is core::ptr. I think core::ptr is correct.
Meta
rustc --version: HEAD (8cc82ee)
danielhenrymantilla
Metadata
Metadata
Assignees
Labels
A-decl-macros-2-0Area: Declarative macros 2.0 (#39412)Area: Declarative macros 2.0 (#39412)C-bugCategory: This is a bug.Category: This is a bug.F-decl_macro`#![feature(decl_macro)]``#![feature(decl_macro)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.