diff options
| author | bors <bors@rust-lang.org> | 2020-09-26 06:44:28 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-09-26 06:44:28 +0000 |
| commit | fd15e6180d9c48b4f1157e44cdaff6e901e5f854 (patch) | |
| tree | 11801a40b3c4b0ccc7c10b589347b28348705871 /compiler/rustc_middle/src/query | |
| parent | 9e1c4361780e69ed54444a3b03fef0cbbc26b547 (diff) | |
| parent | daf976f6129e5fb16effc48bf91853548774e235 (diff) | |
| download | rust-fd15e6180d9c48b4f1157e44cdaff6e901e5f854.tar.gz rust-fd15e6180d9c48b4f1157e44cdaff6e901e5f854.zip | |
Auto merge of #70743 - oli-obk:eager_const_to_pat_conversion, r=eddyb
Fully destructure constants into patterns r? `@varkor` as discussed in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/constants.20in.20patterns/near/192789924 we should probably crater it once reviewed
Diffstat (limited to 'compiler/rustc_middle/src/query')
| -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 9c047cbfaef..784d6c3b2ce 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -742,6 +742,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" } } |
