Apply track_caller to closure on expect_non_local()

This commit is contained in:
Yuki Okushi 2022-05-10 20:17:38 +09:00
parent 16a0d03698
commit c7db4b08ff
No known key found for this signature in database
GPG Key ID: 379CEEFDD63E5DD7
2 changed files with 5 additions and 1 deletions

View File

@ -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> {

View File

@ -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)]