Skip to content

Commit

Permalink
Merge #776
Browse files Browse the repository at this point in the history
776: More performance improvements r=Marwes a=Marwes



Co-authored-by: Markus Westerlind <marwes91@gmail.com>
  • Loading branch information
bors[bot] and Marwes authored Sep 2, 2019
2 parents 4f76ca6 + 32b1f82 commit a507ed0
Show file tree
Hide file tree
Showing 45 changed files with 1,472 additions and 1,245 deletions.
31 changes: 21 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ travis-ci = { repository = "gluon-lang/gluon" }

[dependencies]
bitflags = "1"
hashbrown = "0.6"
log = "0.4"
quick-error = "1.0.0"
fnv = "1.0.3"
Expand Down
23 changes: 17 additions & 6 deletions base/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ pub struct TypedIdent<Id = Symbol, T = ArcType<Id>> {
}

impl<Id> TypedIdent<Id> {
pub fn new(name: Id) -> TypedIdent<Id> {
pub fn new(name: Id) -> TypedIdent<Id>
where
Id: PartialEq,
{
TypedIdent {
typ: Type::hole(),
name,
Expand Down Expand Up @@ -543,7 +546,10 @@ pub struct ValueBinding<Id> {
pub expr: SpannedExpr<Id>,
}

impl<T> Default for ValueBinding<T> {
impl<T> Default for ValueBinding<T>
where
T: PartialEq,
{
fn default() -> Self {
ValueBinding {
metadata: Default::default(),
Expand Down Expand Up @@ -809,18 +815,23 @@ pub fn walk_ast_type<'a, V: ?Sized + $trait_name<'a>>(
Type::Effect(ref $($mut)* ast_type) => v.visit_ast_type(&$($mut)* ast_type._typ.typ),
Type::EmptyRow => (),
Type::ExtendRow {
ref $($mut)* types,
ref $($mut)* fields,
ref $($mut)* rest,
} => {
for field in fields {
v.visit_ast_type(&$($mut)* field.typ._typ.typ);
}
v.visit_ast_type(&$($mut)* rest._typ.typ);
}
Type::ExtendTypeRow {
ref $($mut)* types,
ref $($mut)* rest,
} => {
for field in types {
if let Some(alias) = field.typ.$try_get_alias() {
v.visit_ast_type(&$($mut)* alias.$unresolved_type()._typ.typ);
}
}
for field in fields {
v.visit_ast_type(&$($mut)* field.typ._typ.typ);
}
v.visit_ast_type(&$($mut)* rest._typ.typ);
}
Type::Alias(ref $($mut)* alias) => {
Expand Down
Loading

0 comments on commit a507ed0

Please sign in to comment.