summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-12-18 15:32:16 +0800
committerJohn Hodge <tpg@mutabah.net>2016-12-18 15:32:16 +0800
commit4beaf4a8239214f69ea1e5146510fc1a8ad7f9f0 (patch)
tree0f99c02a002e0b2b4f10b6aae597330ad442b326
parent98c7112473f986ce4a86f9566a5002168dab363d (diff)
downloadmrust-4beaf4a8239214f69ea1e5146510fc1a8ad7f9f0.tar.gz
HIR Annotate Usage - Only need shared access to deref a raw pointer
-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);
}