aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 58adc8fd3..8d082994a 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -921,6 +921,14 @@ impl SelfParam {
921 }) 921 })
922 .unwrap_or(Access::Owned) 922 .unwrap_or(Access::Owned)
923 } 923 }
924
925 pub fn display(self, db: &dyn HirDatabase) -> &'static str {
926 match self.access(db) {
927 Access::Shared => "&self",
928 Access::Exclusive => "&mut self",
929 Access::Owned => "self",
930 }
931 }
924} 932}
925 933
926impl HasVisibility for Function { 934impl HasVisibility for Function {