Rollup merge of #122784 - jswrenn:tag_for_variant, r=compiler-errors
Add `tag_for_variant` query This query allows for sharing code between `rustc_const_eval` and `rustc_transmutability`. It's a precursor to a PR I'm working on to entirely replace the bespoke layout computations in `rustc_transmutability`. r? `@compiler-errors`
This commit is contained in:
commit
96be3e7cc8
13 changed files with 347 additions and 292 deletions
|
@ -1062,6 +1062,13 @@ rustc_queries! {
|
|||
}
|
||||
}
|
||||
|
||||
/// Computes the tag (if any) for a given type and variant.
|
||||
query tag_for_variant(
|
||||
key: (Ty<'tcx>, abi::VariantIdx)
|
||||
) -> Option<ty::ScalarInt> {
|
||||
desc { "computing variant tag for enum" }
|
||||
}
|
||||
|
||||
/// Evaluates a constant and returns the computed allocation.
|
||||
///
|
||||
/// **Do not use this** directly, use the `eval_to_const_value` or `eval_to_valtree` instead.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue