about summary refs log tree commit diff
path: root/src/comp/middle/ty.rs
AgeCommit message (Collapse)AuthorLines
2012-03-02Move src/comp to src/rustcGraydon Hoare-2400/+0
2012-02-24Encode/decode AST into metadata, re-instantiate inlined itemsNiko Matsakis-0/+5
2012-02-23Make sure fold_ty preserves associated def_idsMarijn Haverbeke-0/+4
Closes #1884
2012-02-21Clean up unification codeMarijn Haverbeke-328/+116
2012-02-21Clean up some FIXMEs in middle:: modulesMarijn Haverbeke-25/+13
Rename all TODOs to FIXMEs
2012-02-20More work on typechecking classesTim Chevalier-1/+0
classes-simple doesn't fail until trans now!
2012-02-20Further work on resolving and typechecking classesTim Chevalier-3/+16
Class tests aren't working yet, but they fail a little later :-) Also, make the parser correctly set a constructor's result type to its enclosing class type.
2012-02-15make mut a keyword synonymous with mutableNiko Matsakis-27/+30
first step towards issue #1273
2012-02-13Track purity/unsafety of iface and impl methodsMarijn Haverbeke-1/+4
Closes #1807
2012-02-11core: Change the argument order for vec::contains, vec::countBrian Anderson-1/+1
2012-02-11core: Rename vec::member to vec::contains to match str modBrian Anderson-1/+1
2012-02-10create serialization lib and update serializer to use itNiko Matsakis-1/+1
2012-02-10use absolute names when pretty-printing typesNiko Matsakis-14/+15
2012-02-10put serializer into the build and encode full item pathsNiko Matsakis-0/+39
2012-02-10create serializer project which autogenerates serialization codeNiko Matsakis-1/+15
2012-02-10Represent boxed ifaces in a way similar to functionsMarijn Haverbeke-2/+2
They are now a (dictptr, box) pair, where box is a regular boxed representation of the inner type. This cuts down on some special case code. Also removes some code from trans::base that was moved to shape but then somehow restored in trans::base through a bad merge. Starts on issue #1567
2012-02-09Further WIP on classesTim Chevalier-2/+17
Changes to resolve and typeck. Still nothning working yet.
2012-02-09Fix various bugs in monomorphizationMarijn Haverbeke-7/+7
Enough to be able to compile librustc with --monomorphize. Issue #1736
2012-02-09Remove some pointless importsMarijn Haverbeke-9/+1
2012-02-08Monomorphize resource and variant constructorsMarijn Haverbeke-5/+0
Issue #1736
2012-02-07Reuse monomorphized functions for different box typesMarijn Haverbeke-83/+42
The free glue for opaque boxes will pick the actual tydesc out of the box, and call its glue. Issue #1736
2012-02-06Make ty::t type self-sufficientMarijn Haverbeke-519/+336
It is now no longer needed to have a ty::ctxt to get at the contents of a ty::t. The straight-forward approach of doing this, simply making ty::t a box type, unfortunately killed our compiler performance (~15% slower) through refcounting cost. Thus, this patch now represents ty::t as an unsafe pointer, assuming that the ty::ctxt, which holds these boxes alive, outlives any uses of the ty::t values. In the current compiler this trivially holds, but it is does of course add a new potential pitfall. ty::get takes a ty::t and returns a boxed representation of the type. I've changed calls to ty::struct(X) to do ty::get(X).struct. Type structs are full of vectors, and copying them every time we wanted to access them was a bit of a cost.
2012-02-06Self types for ifacesMarijn Haverbeke-44/+19
This allows a 'Name:' to appear in front of an iface declaration's name, which will cause 'Name' to refer to the self type (with the same number of type parameters as the iface has) in the method signatures of the iface. For example: iface F: functor<A> { fn fmap<B>(f: fn(A) -> B) -> F<B>; } Issue #1718
2012-02-05don't fail if inference is not completeNiko Matsakis-0/+1
2012-02-05infer modes rather than overwriting with expected tyNiko Matsakis-17/+99
2012-02-03core: rename str::lteq to str::leTom Lee-1/+1
2012-02-03Start on in-crate monomorphizingMarijn Haverbeke-6/+3
Adds a --monomorpize flag to rustc to turn it on. You probably don't want to use it yet, since it's broken in a whole bunch of ways, but it successfully monomorphizes simple generic functions called from within the crate. Issue #1736
2012-02-03Store item paths in ast_map, get rid of trans::local_ctxtMarijn Haverbeke-1/+1
The direct motivation for this was that the monomorphizer needs to be able to generate sane symbols for random items. The typechecker can probably also use this in the future to provide more useful error messages.
2012-02-01Remove support for native typesMarijn Haverbeke-39/+9
Issue #1673
2012-01-31Change option::t to optionTim Chevalier-14/+14
Now that core exports "option" as a synonym for option::t, search-and- replace option::t with option. The only place that still refers to option::t are the modules in libcore that use option, because fixing this requires a new snapshot (forthcoming).
2012-01-31Require alts to be exhaustiveTim Chevalier-16/+39
middle::check_alt does the work. Lots of changes to add default cases into alts that were previously inexhaustive.
2012-01-31Move walk_ty to stack closureMarijn Haverbeke-40/+25
2012-01-30Substitute type parameters more eagerlyMarijn Haverbeke-56/+11
This simplifies the typechecker a bit (no more ty_param_substs_opt_and_ty) and is needed for another experiment I'm playing with. I hope it also makes compilation faster (the bots will tell).
2012-01-30Revert self typesMarijn Haverbeke-13/+18
2012-01-27Make occurs check in ty::fixup_vars more reliableMarijn Haverbeke-11/+19
It wouldn't detect cycles that went through several type vars before. Closes #1464
2012-01-27Properly check enum types for recursionMarijn Haverbeke-0/+1
Closes #742
2012-01-26Allow operator overloading of the indexing operatorMarijn Haverbeke-3/+4
The method `op_index` (which takes a single argument) is used for this. Issue #1520
2012-01-26Remove ty_native_fnMarijn Haverbeke-58/+4
It was being used as a clumsy synonym of ty_fn.
2012-01-25Implement implicit self type parameters for ifacesMarijn Haverbeke-20/+15
Closes #1661
2012-01-25Rename tag to enum throughout the compilerMarijn Haverbeke-45/+45
This should reduce confusion of people trying to read the code.
2012-01-23s/block()/fn()/gNiko Matsakis-5/+4
2012-01-19rustc: ";" to "," in enumsPatrick Walton-60/+60
2012-01-19rustc: "tag" -> "enum"Patrick Walton-14/+14
2012-01-19Remove support for the '.' after a nullary tag in a patternTim Chevalier-1/+1
(Commit also includes lots of changes to remove '.'s that a git merge messed up, or else it was monkeys.)
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-159/+159
Does what it says on the tin. The next commit will remove support for this syntax.
2012-01-18remove align_mode and rewrite GEP_tup_like to align correctlyNiko Matsakis-2/+3
Although the old version of GEP_tup_like was incorrect in some cases, I do not believe we ever used it in an incorrect fashion. In particular, it could go wrong with extended index sequences like [0, 1, 3], but as near as I can tell we only ever use it with short sequences like [0, i].
2012-01-18correct use of GEP_tup_like in closure constrNiko Matsakis-6/+2
also, streamline type_is_tup_like() to the cases which actually work
2012-01-17Merge pull request #1544 from kevina/issue-1393Graydon Hoare-2/+2
Minor cleanups to custom discriminator code.
2012-01-17encode variant names and have log print them out.Niko Matsakis-2/+3
2012-01-17Allow omission of the '.' after nullary tag patternsTim Chevalier-14/+23
This commit allows patterns like: alt x { some(_) { ... } none { } } without the '.' after none. The parser suspends judgment about whether a bare ident is a tag or a new bound variable; instead, the resolver disambiguates. This means that any code after resolution that pattern-matches on patterns needs to call pat_util::normalize_pat, which consults an environment to do this disambiguation. In addition, local variables are no longer allowed to shadow tag names, so this required changing some code (e.g. renaming variables named "mut", and renaming ast::sub to subtract). The parser currently accepts patterns with and without the '.'. Once the compiler and libraries are changed, it will no longer accept the '.'.