This commit is contained in:
Aleksey Kladov 2019-04-11 16:39:56 +03:00
parent 5471c1ef4b
commit 3c9f2d0e37

View File

@ -455,11 +455,7 @@ impl DefWithBody {
}
pub fn body_source_map(&self, db: &impl HirDatabase) -> Arc<BodySourceMap> {
match *self {
DefWithBody::Const(ref c) => c.body_source_map(db),
DefWithBody::Function(ref f) => f.body_source_map(db),
DefWithBody::Static(ref s) => s.body_source_map(db),
}
db.body_with_source_map(*self).1
}
/// Builds a resolver for code inside this item.
@ -610,6 +606,7 @@ impl Const {
db.infer((*self).into())
}
#[cfg(test)]
pub(crate) fn body_source_map(&self, db: &impl HirDatabase) -> Arc<BodySourceMap> {
db.body_with_source_map((*self).into()).1
}
@ -683,6 +680,7 @@ impl Static {
db.infer((*self).into())
}
#[cfg(test)]
pub(crate) fn body_source_map(&self, db: &impl HirDatabase) -> Arc<BodySourceMap> {
db.body_with_source_map((*self).into()).1
}