Skip to content

Commit a507ed0

Browse files
bors[bot]Marwes
andauthored
Merge #776
776: More performance improvements r=Marwes a=Marwes Co-authored-by: Markus Westerlind <[email protected]>
2 parents 4f76ca6 + 32b1f82 commit a507ed0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1472
-1245
lines changed

Cargo.lock

Lines changed: 21 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

base/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ travis-ci = { repository = "gluon-lang/gluon" }
1717

1818
[dependencies]
1919
bitflags = "1"
20+
hashbrown = "0.6"
2021
log = "0.4"
2122
quick-error = "1.0.0"
2223
fnv = "1.0.3"

base/src/ast.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ pub struct TypedIdent<Id = Symbol, T = ArcType<Id>> {
188188
}
189189

190190
impl<Id> TypedIdent<Id> {
191-
pub fn new(name: Id) -> TypedIdent<Id> {
191+
pub fn new(name: Id) -> TypedIdent<Id>
192+
where
193+
Id: PartialEq,
194+
{
192195
TypedIdent {
193196
typ: Type::hole(),
194197
name,
@@ -543,7 +546,10 @@ pub struct ValueBinding<Id> {
543546
pub expr: SpannedExpr<Id>,
544547
}
545548

546-
impl<T> Default for ValueBinding<T> {
549+
impl<T> Default for ValueBinding<T>
550+
where
551+
T: PartialEq,
552+
{
547553
fn default() -> Self {
548554
ValueBinding {
549555
metadata: Default::default(),
@@ -809,18 +815,23 @@ pub fn walk_ast_type<'a, V: ?Sized + $trait_name<'a>>(
809815
Type::Effect(ref $($mut)* ast_type) => v.visit_ast_type(&$($mut)* ast_type._typ.typ),
810816
Type::EmptyRow => (),
811817
Type::ExtendRow {
812-
ref $($mut)* types,
813818
ref $($mut)* fields,
814819
ref $($mut)* rest,
820+
} => {
821+
for field in fields {
822+
v.visit_ast_type(&$($mut)* field.typ._typ.typ);
823+
}
824+
v.visit_ast_type(&$($mut)* rest._typ.typ);
825+
}
826+
Type::ExtendTypeRow {
827+
ref $($mut)* types,
828+
ref $($mut)* rest,
815829
} => {
816830
for field in types {
817831
if let Some(alias) = field.typ.$try_get_alias() {
818832
v.visit_ast_type(&$($mut)* alias.$unresolved_type()._typ.typ);
819833
}
820834
}
821-
for field in fields {
822-
v.visit_ast_type(&$($mut)* field.typ._typ.typ);
823-
}
824835
v.visit_ast_type(&$($mut)* rest._typ.typ);
825836
}
826837
Type::Alias(ref $($mut)* alias) => {

0 commit comments

Comments
 (0)