-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HIR and TyCtxt disagree about the parents of decl macros #77828
Comments
This is one of the problems causing #74355. |
Curious, and good catch! Who would be a HIR expert we could ask about this? |
I don't know. Maybe @ecstatic-morse? |
Hmm, this is still the case when the const C: () = {
pub macro m() {} // <- `def.hir_id()`
}; now yields:
Should a new issue be opened, or this one be re-opened? |
@danielhenrymantilla which case did #80415 fix? Is the bug fixed for things in modules, but not in other contexts? |
It looks like it: it definitely fixes it for macros inside |
I don't think this is an issue any more. |
Interesting, so it's intended that |
I tried this code:
rust/library/core/src/ptr/mod.rs
Lines 1487 to 1492 in 8cc82ee
I expected to see this happen:
tcx.hir().parent_module(raw_const_hir_id)
andtcx.parent(raw_const_def_id).unwrap()
are both the modulecore::ptr
.Instead, this happened:
tcx.hir().parent_module(raw_const_hir_id)
iscore
andtcx.parent(raw_const_def_id).unwrap()
iscore::ptr
. I thinkcore::ptr
is correct.Meta
rustc --version
: HEAD (8cc82ee)The text was updated successfully, but these errors were encountered: