summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hir_expand/annotate_value_usage.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/hir_expand/annotate_value_usage.cpp b/src/hir_expand/annotate_value_usage.cpp
index 2634920e..4aaf1f84 100644
--- a/src/hir_expand/annotate_value_usage.cpp
+++ b/src/hir_expand/annotate_value_usage.cpp
@@ -232,6 +232,11 @@ namespace {
auto _ = push_usage( ::HIR::ValueUsage::Borrow );
this->visit_node_ptr(node.m_value);
}
+ // Pointers only need a borrow to be derefernced.
+ else if( node.m_res_type.m_data.is_Pointer() ) {
+ auto _ = push_usage( ::HIR::ValueUsage::Borrow );
+ this->visit_node_ptr(node.m_value);
+ }
else {
this->visit_node_ptr(node.m_value);
}