Add a query for dereferencing constants of reference type

This commit is contained in:
Oliver Scherer 2020-07-01 11:41:38 +02:00
parent b54f122a1c
commit 34c62e0abc
3 changed files with 53 additions and 1 deletions

View file

@ -749,6 +749,14 @@ rustc_queries! {
desc { "destructure constant" }
}
/// Dereference a constant reference or raw pointer and turn the result into a constant
/// again.
query deref_const(
key: ty::ParamEnvAnd<'tcx, &'tcx ty::Const<'tcx>>
) -> &'tcx ty::Const<'tcx> {
desc { "deref constant" }
}
query const_caller_location(key: (rustc_span::Symbol, u32, u32)) -> ConstValue<'tcx> {
desc { "get a &core::panic::Location referring to a span" }
}