Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/closure.rs')
| -rw-r--r-- | crates/hir-ty/src/infer/closure.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/hir-ty/src/infer/closure.rs b/crates/hir-ty/src/infer/closure.rs index d3acbf7b40..df2ad7af34 100644 --- a/crates/hir-ty/src/infer/closure.rs +++ b/crates/hir-ty/src/infer/closure.rs @@ -118,6 +118,7 @@ pub(crate) struct HirPlace { pub(crate) local: BindingId, pub(crate) projections: Vec<ProjectionElem<Infallible, Ty>>, } + impl HirPlace { fn ty(&self, ctx: &mut InferenceContext<'_>) -> Ty { let mut ty = ctx.table.resolve_completely(ctx.result[self.local].clone()); @@ -161,6 +162,10 @@ pub struct CapturedItem { } impl CapturedItem { + pub fn local(&self) -> BindingId { + self.place.local + } + pub fn display_kind(&self) -> &'static str { match self.kind { CaptureKind::ByRef(k) => match k { |