diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2020-07-01 11:41:38 +0200 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2020-09-20 12:42:44 +0200 |
| commit | 34c62e0abc82b7302a3b0ee16dfe445e1330ce4c (patch) | |
| tree | 6e199f1ddac1e8d5432768c29f08dba327de70a0 /compiler/rustc_middle/src/query/mod.rs | |
| parent | b54f122a1cb2593325501a2ed5b3fbfc47293615 (diff) | |
| download | rust-34c62e0abc82b7302a3b0ee16dfe445e1330ce4c.tar.gz rust-34c62e0abc82b7302a3b0ee16dfe445e1330ce4c.zip | |
Add a query for dereferencing constants of reference type
Diffstat (limited to 'compiler/rustc_middle/src/query/mod.rs')
| -rw-r--r-- | compiler/rustc_middle/src/query/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 44d906dada5..68bad428ea2 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -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" } } |
