Unnamed repository; edit this file 'description' to name the repository.
Rollup merge of #151295 - const-to-pat, r=BoxyUwU
THIR patterns: Use `ty::Value` in more places throughout `const_to_pat` This PR changes `ConstToPat::valtree_to_pat` to take a `ty::Value` instead of separate type and valtree arguments, and propagates that change throughout other parts of the overall `const_to_pat` implementation. The biggest under-the-hood change is that instead of combining valtrees from the constant with child types from the parent type, we now just rely on the types already embedded in children of the valtree. I'm not *entirely* sure that this is correct, but it doesn't seem to cause any failures in the test suite, and from what I can tell the old way was a holdover from a time when the types weren't readily available from the value side. --- My ulterior motive for this cleanup is that I'm hoping to eventually add some extra data to `thir::PatKind::Const`, which will be a little easier if creation of that `PatKind::Const` doesn't have to assemble a `ty::Value` from component parts.
Jonathan Brouwer 3 months ago
parent 885d5fd · parent 6b480a8 · commit 786fab9
0 files changed, 0 insertions, 0 deletions