diff options
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 5f480c304..3fc2eccdd 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -22,8 +22,11 @@ use hir_expand::{ | |||
22 | MacroDefId, MacroDefKind, | 22 | MacroDefId, MacroDefKind, |
23 | }; | 23 | }; |
24 | use hir_ty::{ | 24 | use hir_ty::{ |
25 | autoderef, display::HirFormatter, expr::ExprValidator, method_resolution, ApplicationTy, | 25 | autoderef, |
26 | Canonical, InEnvironment, Substs, TraitEnvironment, Ty, TyDefId, TypeCtor, | 26 | display::{HirDisplayError, HirFormatter}, |
27 | expr::ExprValidator, | ||
28 | method_resolution, ApplicationTy, Canonical, InEnvironment, Substs, TraitEnvironment, Ty, | ||
29 | TyDefId, TypeCtor, | ||
27 | }; | 30 | }; |
28 | use ra_db::{CrateId, CrateName, Edition, FileId}; | 31 | use ra_db::{CrateId, CrateName, Edition, FileId}; |
29 | use ra_prof::profile; | 32 | use ra_prof::profile; |
@@ -675,6 +678,10 @@ impl Static { | |||
675 | pub fn name(self, db: &dyn HirDatabase) -> Option<Name> { | 678 | pub fn name(self, db: &dyn HirDatabase) -> Option<Name> { |
676 | db.static_data(self.id).name.clone() | 679 | db.static_data(self.id).name.clone() |
677 | } | 680 | } |
681 | |||
682 | pub fn is_mut(self, db: &dyn HirDatabase) -> bool { | ||
683 | db.static_data(self.id).mutable | ||
684 | } | ||
678 | } | 685 | } |
679 | 686 | ||
680 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 687 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
@@ -1319,7 +1326,7 @@ impl Type { | |||
1319 | } | 1326 | } |
1320 | 1327 | ||
1321 | impl HirDisplay for Type { | 1328 | impl HirDisplay for Type { |
1322 | fn hir_fmt(&self, f: &mut HirFormatter) -> std::fmt::Result { | 1329 | fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> { |
1323 | self.ty.value.hir_fmt(f) | 1330 | self.ty.value.hir_fmt(f) |
1324 | } | 1331 | } |
1325 | } | 1332 | } |