From 95fe1941a1f75de979c8e7201385f53ebc000735 Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 21 Feb 2019 18:39:41 -0800 Subject: [PATCH] Kill some unused items --- schala-lang/language/src/builtin.rs | 1 - schala-lang/language/src/symbol_table.rs | 4 ++-- schala-lang/language/src/typechecking.rs | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/schala-lang/language/src/builtin.rs b/schala-lang/language/src/builtin.rs index b05a532..f8fea40 100644 --- a/schala-lang/language/src/builtin.rs +++ b/schala-lang/language/src/builtin.rs @@ -3,7 +3,6 @@ use std::collections::HashMap; use crate::tokenizing::TokenKind; use crate::typechecking::{TypeConst, Type}; -use crate::typechecking::TypeConst::*; #[derive(Debug, PartialEq, Clone)] pub struct BinOp { diff --git a/schala-lang/language/src/symbol_table.rs b/schala-lang/language/src/symbol_table.rs index 5ec5752..f7d0691 100644 --- a/schala-lang/language/src/symbol_table.rs +++ b/schala-lang/language/src/symbol_table.rs @@ -55,7 +55,7 @@ impl fmt::Display for SymbolSpec { match self { Func(type_names) => write!(f, "Func({:?})", type_names), DataConstructor { index, type_name, type_args } => write!(f, "DataConstructor(idx: {})({:?} -> {})", index, type_args, type_name), - RecordConstructor { fields } => write!(f, "RecordConstructor( )"), + RecordConstructor { fields: _fields } => write!(f, "RecordConstructor( )"), } } } @@ -130,7 +130,7 @@ impl SymbolTable { }, //TODO if there is only one variant, and it is a record, it doesn't need to have an //explicit name - Variant::Record { name, members } => { + Variant::Record { name, members: _members } => { let fields = HashMap::new(); let spec = SymbolSpec::RecordConstructor { fields }; let symbol = Symbol { name: name.clone(), spec }; diff --git a/schala-lang/language/src/typechecking.rs b/schala-lang/language/src/typechecking.rs index 835fabc..7584731 100644 --- a/schala-lang/language/src/typechecking.rs +++ b/schala-lang/language/src/typechecking.rs @@ -335,7 +335,7 @@ impl<'a> TypeContext<'a> { } fn unify(&mut self, t1: Type, t2: Type) -> InferResult { - use self::Type::*; use self::TypeConst::*; + use self::Type::*; Ok(match (t1, t2) { (Const(ref c1), Const(ref c2)) if c1 == c2 => Const(c1.clone()), //choice of c1 is arbitrary I *think* (a, b) => return TypeError::new(format!("{:?} and {:?} do not unify", a, b)),