aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir
diff options
context:
space:
mode:
authorPaul Daniel Faria <[email protected]>2020-06-27 22:11:43 +0100
committerPaul Daniel Faria <[email protected]>2020-08-10 13:44:54 +0100
commitd5f11e530dbf6edbdd0ca32d6cd5fafe634c8c4a (patch)
treeb348ea6d5552be08913ac3a451836cad5ac75c1a /crates/ra_hir
parent38440d53d8329ac9f3f2013c6e32b3f69b069c72 (diff)
Unsafe borrow of packed fields: account for borrow through ref binding, auto ref function calls
Diffstat (limited to 'crates/ra_hir')
-rw-r--r--crates/ra_hir/src/code_model.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index 0007d7fa8..a880fa671 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -11,6 +11,7 @@ use hir_def::{
11 docs::Documentation, 11 docs::Documentation,
12 expr::{BindingAnnotation, Pat, PatId}, 12 expr::{BindingAnnotation, Pat, PatId},
13 import_map, 13 import_map,
14 item_tree::SelfParam,
14 per_ns::PerNs, 15 per_ns::PerNs,
15 resolver::{HasResolver, Resolver}, 16 resolver::{HasResolver, Resolver},
16 src::HasSource as _, 17 src::HasSource as _,
@@ -670,8 +671,8 @@ impl Function {
670 db.function_data(self.id).name.clone() 671 db.function_data(self.id).name.clone()
671 } 672 }
672 673
673 pub fn has_self_param(self, db: &dyn HirDatabase) -> bool { 674 pub fn self_param(self, db: &dyn HirDatabase) -> Option<SelfParam> {
674 db.function_data(self.id).has_self_param 675 db.function_data(self.id).self_param
675 } 676 }
676 677
677 pub fn params(self, db: &dyn HirDatabase) -> Vec<TypeRef> { 678 pub fn params(self, db: &dyn HirDatabase) -> Vec<TypeRef> {