diff options
author | Florian Diebold <[email protected]> | 2019-02-23 14:24:07 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-02-23 14:36:38 +0000 |
commit | dcfb4ee70254ec696801cbdb22d2de2bb1c939ed (patch) | |
tree | 8d36f12550779a0d51c46d706f96a09df16059a3 /crates/ra_hir/src/code_model_api.rs | |
parent | 460ceb4cf2b8217abd002f8a30ef52f2aa25fee9 (diff) |
Split ty.rs into several modules
It was just getting too big. We now have:
- ty: the `Ty` enum and helpers
- ty::infer: actual type inference
- ty::lower: lowering from HIR to `Ty`
- ty::op: helpers for binary operations, currently
Diffstat (limited to 'crates/ra_hir/src/code_model_api.rs')
-rw-r--r-- | crates/ra_hir/src/code_model_api.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 9da8a482d..9d0b40ce0 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs | |||
@@ -483,6 +483,10 @@ impl Function { | |||
483 | db.body_hir(*self) | 483 | db.body_hir(*self) |
484 | } | 484 | } |
485 | 485 | ||
486 | pub fn ty(&self, db: &impl HirDatabase) -> Ty { | ||
487 | db.type_for_def((*self).into(), Namespace::Values) | ||
488 | } | ||
489 | |||
486 | pub fn scopes(&self, db: &impl HirDatabase) -> ScopesWithSyntaxMapping { | 490 | pub fn scopes(&self, db: &impl HirDatabase) -> ScopesWithSyntaxMapping { |
487 | let scopes = db.expr_scopes(*self); | 491 | let scopes = db.expr_scopes(*self); |
488 | let syntax_mapping = db.body_syntax_mapping(*self); | 492 | let syntax_mapping = db.body_syntax_mapping(*self); |