Robustify the TyKind
ambig/unambig layout compatibility tests
#135944
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Originally posted by @compiler-errors in #135272 (comment)
#135272 introduced a very interesting trick where we transmute between two variants of
hir::TyKind<U>
-- namelyhir::TyKind<()>
andhir::TyKind<!>
-- to represent the presence or not of a variant ofTyKind::Infer
which is superseded in certain contexts by a more general infer kind that is shared between consts and types.As of that PR landing, there's a test (
compiler/rustc_hir/src/lib.rs
) that exercises the layout compatibility between theseTyKind
s, but it could be fleshed out some more.The text was updated successfully, but these errors were encountered: