From b6f57069b75febf1d312a98efcd6544c9db2fe59 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 4 May 2019 14:19:43 +0200 Subject: Remove dummy lifetimes --- dhall/src/typecheck.rs | 167 ++++++++++++++++++++++--------------------------- 1 file changed, 74 insertions(+), 93 deletions(-) (limited to 'dhall/src/typecheck.rs') diff --git a/dhall/src/typecheck.rs b/dhall/src/typecheck.rs index 69491c8..74de59b 100644 --- a/dhall/src/typecheck.rs +++ b/dhall/src/typecheck.rs @@ -14,21 +14,18 @@ use dhall_syntax::*; use self::TypeMessage::*; -impl<'a> Resolved<'a> { - pub fn typecheck(self) -> Result, TypeError> { +impl Resolved { + pub fn typecheck(self) -> Result { type_of(self.0.unnote()) } - pub fn typecheck_with( - self, - ty: &Type, - ) -> Result, TypeError> { + pub fn typecheck_with(self, ty: &Type) -> Result { let expr: SubExpr<_, _> = self.0.unnote(); let ty: SubExpr<_, _> = ty.to_expr().embed_absurd(); type_of(rc(ExprF::Annot(expr, ty))) } /// Pretends this expression has been typechecked. Use with care. #[allow(dead_code)] - pub fn skip_typecheck(self) -> Typed<'a> { + pub fn skip_typecheck(self) -> Typed { Typed::from_thunk_untyped(Thunk::new( NormalizationContext::new(), self.0.unnote(), @@ -36,8 +33,8 @@ impl<'a> Resolved<'a> { } } -impl<'a> Typed<'a> { - fn to_type(&self) -> Type<'a> { +impl Typed { + fn to_type(&self) -> Type { match &self.to_value() { Value::Const(c) => Type(TypeInternal::Const(*c)), _ => Type(TypeInternal::Typed(Box::new(self.clone()))), @@ -45,17 +42,17 @@ impl<'a> Typed<'a> { } } -impl<'a> Normalized<'a> { +impl Normalized { fn shift(&self, delta: isize, var: &V