diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2022-05-10 20:17:38 +0900 |
|---|---|---|
| committer | Yuki Okushi <jtitor@2k36.org> | 2022-05-31 23:57:13 +0900 |
| commit | c7db4b08fff9591adb2c7a66d5f81ce685655622 (patch) | |
| tree | cf8909f9f33bd4648c44deb91b4735ae4e62ce4f /compiler | |
| parent | 16a0d03698bfc9f93250490797f9a1a870f8bcfe (diff) | |
| download | rust-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.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/lib.rs | 1 |
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)] |
