From db6c09f33c3c794e4b6ec8a7aa80978d945a9d7a Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 29 Jan 2020 21:26:42 +0000 Subject: Remove dead code --- dhall/src/error/mod.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'dhall/src/error') diff --git a/dhall/src/error/mod.rs b/dhall/src/error/mod.rs index 5330c59..215a7bf 100644 --- a/dhall/src/error/mod.rs +++ b/dhall/src/error/mod.rs @@ -3,7 +3,7 @@ use std::io::Error as IOError; use crate::semantics::core::value::Value; use crate::semantics::phase::resolve::ImportStack; use crate::semantics::phase::NormalizedExpr; -use crate::syntax::{Import, Label, ParseError, Span}; +use crate::syntax::{Import, ParseError}; pub type Result = std::result::Result; @@ -45,7 +45,7 @@ pub struct TypeError { /// The specific type error #[derive(Debug)] pub(crate) enum TypeMessage { - UnboundVariable(Span), + // UnboundVariable(Span), InvalidInputType(Value), InvalidOutputType(Value), // NotAFunction(Value), @@ -57,7 +57,7 @@ pub(crate) enum TypeMessage { // InvalidPredicate(Value), // IfBranchMismatch(Value, Value), // IfBranchMustBeTerm(bool, Value), - InvalidFieldType(Label, Value), + // InvalidFieldType(Label, Value), // NotARecord(Label, Value), // MustCombineRecord(Value), // MissingRecordField(Label, Value), @@ -76,9 +76,9 @@ pub(crate) enum TypeMessage { // ProjectionMissingEntry, // ProjectionDuplicateField, Sort, - RecordTypeDuplicateField, + // RecordTypeDuplicateField, // RecordTypeMergeRequiresRecordType(Value), - UnionTypeDuplicateField, + // UnionTypeDuplicateField, // EquivalenceArgumentMustBeTerm(bool, Value), // EquivalenceTypeMismatch(Value, Value), // AssertMismatch(Value, Value), @@ -96,7 +96,7 @@ impl std::fmt::Display for TypeError { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { use TypeMessage::*; let msg = match &self.message { - UnboundVariable(var) => var.error("Type error: Unbound variable"), + // UnboundVariable(var) => var.error("Type error: Unbound variable"), InvalidInputType(v) => { v.span().error("Type error: Invalid function input") } @@ -171,8 +171,3 @@ impl From for Error { Error::Typecheck(err) } } -impl From for Error { - fn from(_: crate::semantics::nze::nzexpr::TypeError) -> Error { - Error::Decode(DecodeError::WrongFormatError("type error".to_string())) - } -} -- cgit v1.2.3