We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 312eafe commit d5de7c2Copy full SHA for d5de7c2
crates/hir/src/lib.rs
@@ -1458,14 +1458,7 @@ impl Const {
1458
}
1459
1460
pub fn value(self, db: &dyn HirDatabase) -> Option<ast::Expr> {
1461
- let loc = self.id.lookup(db.upcast());
1462
- let item_tree = loc.id.item_tree(db.upcast());
1463
- let ast_id = item_tree[loc.id.value].ast_id;
1464
- let ast_id_map = db.ast_id_map(loc.id.file_id());
1465
- let ast_ptr = ast_id_map.get(ast_id);
1466
- let syntax_node = db.parse_or_expand(loc.id.file_id())?;
1467
- let ast_node = ast_ptr.to_node(&syntax_node);
1468
- ast_node.body()
+ self.source(db)?.value.body()
1469
1470
1471
pub fn ty(self, db: &dyn HirDatabase) -> Type {
0 commit comments