about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2024-06-29 21:45:22 -0700
committerNoah Lev <camelidcamel@gmail.com>2024-07-16 19:27:28 -0700
commit71f8aed510c563cc2d96405df51b410783be75c0 (patch)
treea733c2b1e7dc8b3d153b2d056b643b2e40cf05e8 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent7d356ebde329df5f38186efe3e7c5e8dabac7cb7 (diff)
downloadrust-71f8aed510c563cc2d96405df51b410783be75c0.tar.gz
rust-71f8aed510c563cc2d96405df51b410783be75c0.zip
Add `current_def_id_parent` to `LoweringContext`
This is needed to track anon const parents properly once we implement
`ConstArgKind::Path` (which requires moving anon const def-creation
outside of `DefCollector`):

    Why do we need this in addition to [`Self::current_hir_id_owner`]?

    Currently (as of June 2024), anonymous constants are not HIR owners;
    however, they do get their own DefIds. Some of these DefIds have to be
    created during AST lowering, rather than def collection, because we
    can't tell until after name resolution whether an anonymous constant
    will end up instead being a [`rustc_hir::ConstArgKind::Path`]. However,
    to compute which generics are available to an anonymous constant nested
    inside another, we need to make sure that the parent is recorded as the
    parent anon const, not the enclosing item. So we need to track parent
    defs differently from HIR owners, since they will be finer-grained in
    the case of anon consts.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions