rustc: Remove local variable IDs from Exports

Local variables can never be exported.
This commit is contained in:
Vadim Petrochenkov 2021-09-05 23:37:15 +03:00
parent b69fe57261
commit 294510e1bb
19 changed files with 71 additions and 68 deletions

View file

@ -598,6 +598,11 @@ impl<Id> Res<Id> {
}
}
#[track_caller]
pub fn expect_non_local<OtherId>(self) -> Res<OtherId> {
self.map_id(|_| panic!("unexpected `Res::Local`"))
}
pub fn macro_kind(self) -> Option<MacroKind> {
match self {
Res::Def(DefKind::Macro(kind), _) => Some(kind),