1
Fork 0

Rollup merge of #88677 - petrochenkov:exportid, r=davidtwco

rustc: Remove local variable IDs from `Export`s

Local variables can never be exported.
This commit is contained in:
Manish Goregaokar 2021-09-12 03:44:53 -07:00 committed by GitHub
commit bb5ca58d29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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),