Add tag_for_variant query
This query allows for sharing code between `rustc_const_eval` and `rustc_transmutability`. Also moves `DummyMachine` to `rustc_const_eval`.
This commit is contained in:
@@ -1042,6 +1042,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.
|
||||
|
||||
Reference in New Issue
Block a user