about summary refs log tree commit diff
path: root/src/comp
AgeCommit message (Collapse)AuthorLines
2011-06-09Start to check expr_check and expr_call constraints in typestateTim Chevalier-3/+61
Start writing the cases for expr_check and expr_call to take predicates into account, but this isn't working yet.
2011-06-09Further support for predicate constraintsTim Chevalier-609/+969
Changed function types to include a list of constraints. Added code for parsing and pretty-printing constraints. This necessitated splitting pprust into two files (pprust and ppaux) to break a circulate dependency, as ty_to_str now needs to print out constraints, which may include literals, but pprust depended on ty.
2011-06-09rustc: Add fast paths for vars and param folds. 3x typechecking speedup.Patrick Walton-61/+70
2011-06-09rustc: Don't resolve all type variables eagerly for pathsPatrick Walton-18/+25
2011-06-09Properly handle lifetime of aliases in nested blocksMarijn Haverbeke-18/+41
There was a bug that would cause the alias analyser to allow you to invalidate an alias that was no longer directly referred to, even if another alias was rooted in it. It now properly tracks dependencies between live aliases. Required another case of copying values in map.rs.
2011-06-09A revised, improved alias-checkerMarijn Haverbeke-150/+399
The old system tried to ensure that the location an alias pointed at would retain its type. That turned out to not be strong enough in the face of aliases to the inside of tags. The new system instead proves that values pointed to by aliases are not replaced (or invalidated in some other way) at all. It knows of two sufficient conditions for this, and tries to prove at least of them: A) The alias is 'immutably rooted' in a local, and this local is not reassigned for the lifetime of the alias. Immutably rooted means the alias refers to the local itself, or to something reachable from the local through immutable dereferencing. B) No value whose type might include the type of the 'inner mutable element' of the thing the alias refers to (for example, the box in rec(mutable x = @mutable int)) is from the outer scope is accessed for the lifetime of the alias. This means for functions, no other argument types may include the alias's inner mutable type. For alt, for each, and for, it means the body does not refer to any locals originating from outside their scope that include this type. The lifetime of an alias in an alt, for each, or for body is defined as the range from its definition to its last use, not to the point where it goes out of scope. This makes working around these restrictions somewhat less annoying. For example, you can assign to your alt-ed value you don't refer to any bindings afterwards.
2011-06-09Some more workarounds to please the alias checkerMarijn Haverbeke-1/+2
Some of the vec utilities now only work on immutable vecs, since they would have to be rewritten to do a lot more copying to be alias-safe. Some forced copying was added to map.rs, showing a weakness in the alias checker (or maybe the alias system): when fn args are passed into a function, calling them must assume all aliases that are not immutably rooted (directly connected to a local or temporary without any mutable edges) become invalid. This will be a drag on functional programming in Rust. Work around alias issues in the stdlib
2011-06-09Add new visitor frameworkMarijn Haverbeke-0/+382
2011-06-08rustc: Don't eagerly resolve type variables after unificationPatrick Walton-40/+59
2011-06-08rustc: Make resolve_all_vars() check to see whether the type actually has ↵Patrick Walton-14/+7
vars before folding over it; also remove some debug code. 2x typechecking speedup.
2011-06-08rustc: Don't generate so many variables when typechecking functions; remove ↵Patrick Walton-50/+51
mo_either
2011-06-08Tidy up 'export meta' situation now that snapshot understands it.Graydon Hoare-5/+8
2011-06-08rustc: Use cnames in ty_to_str again; debugging code crept inPatrick Walton-6/+4
2011-06-08rustc: Add some miscellaneous demands that pushdown had previously caught; ↵Patrick Walton-1/+13
put out burning tinderbox
2011-06-08rustc: Remove pushdown. 15 second improvement.Patrick Walton-443/+30
2011-06-08Merge pull request #403 from espindola/newllvmGraydon Hoare-2/+7
Update rust to build with newer llvm versions.
2011-06-08Update rust to build with newer llvm versions.Rafael Ávila de Espíndola-2/+7
2011-06-08rustc: Remove all traces of the unification cachePatrick Walton-60/+0
2011-06-08Don't force the fetch of main.o from main.a, we are not using main.a anymore.Rafael Ávila de Espíndola-11/+0
2011-06-08Add optional message to fail.Josh Matthews-13/+36
2011-06-07rustc: Print out a real error message on unresolved types. Puts out burning ↵Patrick Walton-26/+36
tinderbox.
2011-06-07rustc: Use a set-based approach to unification; remove ty_bound_param and ↵Patrick Walton-1179/+1075
ty_local. Sorry, big perf regression; will fix soon.
2011-06-07More work on proper linkage name-mangling. Almost right, aside from version ↵Graydon Hoare-140/+362
numbers.
2011-06-07For consistency, use ctxt instead of ty_ctxt outside of unify.Lindsey Kuper-17/+17
2011-06-07Removing dead code and redundant fails; changing fails to sess.bugLindsey Kuper-158/+93
calls (issue #444).
2011-06-07Don't put a copy of main (the C one) in each binary we produce. This is a stepRafael Ávila de Espíndola-56/+29
in getting a driver that works on all linux systems. Sorry for the linker hacks, I will remove them after snapshotting a new compiler.
2011-06-07Add multiline, whitespace-eating strings.Josh Matthews-0/+3
2011-06-06Begin tidying up name-mangling rules.Graydon Hoare-58/+66
2011-06-06Implement enough support for pointer to get an identity function working.Rafael Ávila de Espíndola-0/+6
2011-06-06First take on an alias-safety checkerMarijn Haverbeke-0/+259
The alias checker works by ensuring that any value to which an alias is created is rooted in some way that ensures it outlives the alias. It is now disallowed to create an alias to the content of a mutable box, or to a box hanging off a mutable field. There is also machinery in place to prevent assignment to local variables whenever they are the root of a live alias.
2011-06-06Change unsafe aliasesMarijn Haverbeke-48/+53
This litters aberrations like 'alt({foo.bar}) { ... }' and f({*baz}) though the code (mostly in trans.rs). These are a way to explicitly copy the given value so that it can be safely aliased. At some point we'll probably want a more explicit copy operator.
2011-06-05rustc: Make resolve::unresolved return !. Remove redundant failsBrian Anderson-8/+1
2011-06-04Adding comments; removing dead code.Lindsey Kuper-12/+18
2011-06-04Remove redundant 'fail' exprs and dead code; use sess.bug orLindsey Kuper-67/+27
sess.span_err instead of 'fail'. (issue #444)
2011-06-04stdlib: Use spans for #fmt errors originating in stdBrian Anderson-1/+7
Issue #444
2011-06-04rustc: Reenable debug logging in extfmtBrian Anderson-8/+7
This is not obnoxious now that logging is off by default
2011-06-04rustc: Hide the parser from syntax extensionsBrian Anderson-9/+5
Eventually extensions will probably need access to the parser again, but it'll be in a different form.
2011-06-04rustc: Generate extension annotations from ext_ctxt instead of parserBrian Anderson-65/+67
2011-06-04rustc: Add a next_ann method to ext_ctxtBrian Anderson-4/+13
After this we can remove the parser from the syntax extensions, at least for now.
2011-06-04rustc: Use spans for #env errorsBrian Anderson-5/+9
Issue #444
2011-06-04rustc: Report unimplemented #fmt features with spansBrian Anderson-26/+22
2011-06-04rustc: Add a span_unimpl method to ext_ctxtBrian Anderson-5/+13
2011-06-04rustc: Use spans on extfmt error messagesBrian Anderson-29/+31
Issue #444
2011-06-04rustc: Return the correct span from parse_seqBrian Anderson-7/+4
2011-06-04rustc: Pass the correct span to syntax extensionsBrian Anderson-1/+2
2011-06-04rustc: Introduce ext module. Move some things from parser to ext.Brian Anderson-24/+68
Introduce an ext_ctxt record to provide a span_err method for use while expanding syntax extensions. Hopefully it will be useful for other things.
2011-06-03"macro" -> "syntax extension" for nowPaul Stansifer-22/+22
2011-06-03Make the macro system more modular.Paul Stansifer-75/+59
2011-06-03Remove zerobreak between foo and ( on a call expr. Never looks right.Graydon Hoare-1/+0
2011-06-03Make pp more conservative about inserting trailing comments mid-list.Graydon Hoare-7/+15