about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-05-10 20:17:38 +0900
committerYuki Okushi <jtitor@2k36.org>2022-05-31 23:57:13 +0900
commitc7db4b08fff9591adb2c7a66d5f81ce685655622 (patch)
treecf8909f9f33bd4648c44deb91b4735ae4e62ce4f /compiler
parent16a0d03698bfc9f93250490797f9a1a870f8bcfe (diff)
downloadrust-c7db4b08fff9591adb2c7a66d5f81ce685655622.tar.gz
rust-c7db4b08fff9591adb2c7a66d5f81ce685655622.zip
Apply track_caller to closure on `expect_non_local()`
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_hir/src/def.rs5
-rw-r--r--compiler/rustc_hir/src/lib.rs1
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs
index 68876e89c4b..414f6272591 100644
--- a/compiler/rustc_hir/src/def.rs
+++ b/compiler/rustc_hir/src/def.rs
@@ -671,7 +671,10 @@ impl<Id> Res<Id> {
 
     #[track_caller]
     pub fn expect_non_local<OtherId>(self) -> Res<OtherId> {
-        self.map_id(|_| panic!("unexpected `Res::Local`"))
+        self.map_id(
+            #[track_caller]
+            |_| panic!("unexpected `Res::Local`"),
+        )
     }
 
     pub fn macro_kind(self) -> Option<MacroKind> {
diff --git a/compiler/rustc_hir/src/lib.rs b/compiler/rustc_hir/src/lib.rs
index 7833571f88d..d845c433d8c 100644
--- a/compiler/rustc_hir/src/lib.rs
+++ b/compiler/rustc_hir/src/lib.rs
@@ -3,6 +3,7 @@
 //! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/hir.html
 
 #![feature(associated_type_defaults)]
+#![feature(closure_track_caller)]
 #![feature(const_btree_new)]
 #![feature(let_else)]
 #![feature(once_cell)]