about summary refs log tree commit diff
path: root/src/librustc/query
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-10-28 04:53:06 +0100
committerGitHub <noreply@github.com>2019-10-28 04:53:06 +0100
commit4728d66206c82c98aa4e1fad751e8aae7489c242 (patch)
treea95e0d577f867d3fba9346478e13bcac3dc793a8 /src/librustc/query
parentc8eefdffe9480bbd84554eab3343f71f04af8f9a (diff)
parent86e55b1882ac492d6234e5c5f97c7f151a11f5d2 (diff)
downloadrust-4728d66206c82c98aa4e1fad751e8aae7489c242.tar.gz
rust-4728d66206c82c98aa4e1fad751e8aae7489c242.zip
Rollup merge of #65664 - anp:panic-location, r=eddyb
`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N)

[Tracking issue](https://github.com/rust-lang/rust/issues/47809)
[RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md)

@eddyb suggested doing this intrinsic implementation ahead of actually implementing the `#[track_caller]` attribute so that there's an easily tested intermediate step between adding the shim and wiring up the attribute.
Diffstat (limited to 'src/librustc/query')
-rw-r--r--src/librustc/query/mod.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs
index 7cae74b59c7..f628e194748 100644
--- a/src/librustc/query/mod.rs
+++ b/src/librustc/query/mod.rs
@@ -466,6 +466,12 @@ rustc_queries! {
             no_force
             desc { "extract field of const" }
         }
+
+        query const_caller_location(key: (syntax_pos::Symbol, u32, u32)) -> &'tcx ty::Const<'tcx> {
+            eval_always
+            no_force
+            desc { "get a &core::panic::Location referring to a span" }
+        }
     }
 
     TypeChecking {