Skip to content

Commit 89ac81a

Browse files
committed
Make all hir::Map methods consistently by-value
(hir::Map only consists of a single reference anyways)
1 parent 5d6ee0d commit 89ac81a

File tree

2 files changed

+84
-84
lines changed

2 files changed

+84
-84
lines changed

compiler/rustc_hir/src/intravisit.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,22 +141,22 @@ pub trait Map<'hir> {
141141
// Used when no map is actually available, forcing manual implementation of nested visitors.
142142
impl<'hir> Map<'hir> for ! {
143143
fn find(&self, _: HirId) -> Option<Node<'hir>> {
144-
unreachable!()
144+
*self;
145145
}
146146
fn body(&self, _: BodyId) -> &'hir Body<'hir> {
147-
unreachable!()
147+
*self;
148148
}
149149
fn item(&self, _: ItemId) -> &'hir Item<'hir> {
150-
unreachable!()
150+
*self;
151151
}
152152
fn trait_item(&self, _: TraitItemId) -> &'hir TraitItem<'hir> {
153-
unreachable!()
153+
*self;
154154
}
155155
fn impl_item(&self, _: ImplItemId) -> &'hir ImplItem<'hir> {
156-
unreachable!()
156+
*self;
157157
}
158158
fn foreign_item(&self, _: ForeignItemId) -> &'hir ForeignItem<'hir> {
159-
unreachable!()
159+
*self;
160160
}
161161
}
162162

0 commit comments

Comments
 (0)