summary refs log tree commit diff
path: root/src/comp/middle/ty.rs
AgeCommit message (Collapse)AuthorLines
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 '.'.
2012-01-16Minor cleanups to custom discriminator code.Kevin Atkinson-2/+2
Mostly updates to the comments and docs from Pull Request #1537.
2012-01-16Store type names in crate metadataMarijn Haverbeke-1/+5
Improves type error messages referring to external types. Issue #1507
2012-01-16Don't evaluate discriminator value constants when parsing.Kevin Atkinson-1/+14
Remove disr_val from ast::variant_ and always use ty::variant_info when the value is needed. Move what was done during parsing into other passes, primary typeck.rs. This move also correctly type checks the disr. value expression; thus, fixing rustc --pretty=typed when disr. values are used.
2012-01-13distinguish "any closure" and "stack closure" (block)Niko Matsakis-1/+3
2012-01-13make blocks fn& and fn stand for "any closure"Niko Matsakis-0/+2
2012-01-13deprecate fn exprs and the fn() type, preferring fn@ and native fnNiko Matsakis-15/+19
2012-01-13Obj system? What obj system?Marijn Haverbeke-103/+6
Removes the obj system from the compiler. Closes #1484
2012-01-12Make driver::session::session no longer an objectMarijn Haverbeke-1/+2
Rather, it is now a struct where properties like opts are accessed directly, and the error-reporting methods are part of a static impl (with the same name as the type).
2012-01-12Cleanups to previous commits for issue #1393.Kevin Atkinson-2/+2
2012-01-10Add support for casting enum-like tags to scalar values.Kevin Atkinson-0/+22
2012-01-10Support explicit discriminant numbers on tag variants.Kevin Atkinson-2/+5
Addresses issue #1393. For now disallow disr. values unless all variants use nullary contractors (i.e. "enum-like"). Disr. values are now encoded in the crate metadata, but only when it will differ from the inferred value based on the order.
2012-01-10rename sendfn to fn~, lambda to fn@Niko Matsakis-15/+15
2012-01-09Change all uses of 'when' in alt-patterns to 'if'Austin Seipp-4/+4
Issue #1396
2012-01-09Remove proto_sugar and 'lambda' as keyword, commit to fn@.Graydon Hoare-4/+3
2012-01-09Iface types are not structuralMarijn Haverbeke-2/+1
Not sure how they ended up being marked as such.
2012-01-08First barely-working version of casting to ifaceMarijn Haverbeke-1/+1
Issue #1437
2012-01-06rejigger impl to have an opaque closure ptr rather thanNiko Matsakis-28/+23
opaque closure
2012-01-06collapse sizeof, alignof into metrics, pass along an instance if availNiko Matsakis-0/+10
2012-01-06make size_of and align_of take an optional valueNiko Matsakis-1/+4
2012-01-05require a non-semi expr acting as a stmt to have unit return typeNiko Matsakis-2/+3
2012-01-05Merge branch 'master' into kmathStefan Plantikow-1/+1
Conflicts: src/libcore/float.rs
2012-01-05Moved generic float::min, max to core::math and cleaned up some importsStefan Plantikow-1/+1
2012-01-05Switch to new param kind bound syntaxMarijn Haverbeke-1/+1
And remove support for the old syntax
2012-01-05Get external interfaces / impls workingMarijn Haverbeke-1/+1
Issue #1227
2012-01-05Write the iface type of an impl in the crate dataMarijn Haverbeke-1/+9
Also, move checking of ifaces into the collect phase of typeck to give further passes some guarantees. Issue #1227
2012-01-05Remove ty::bind_params_in_typeMarijn Haverbeke-18/+0
It does nothing that substitute_type_params can't do better.
2012-01-04Properly typecheck and compile invocations of generic methods.Marijn Haverbeke-32/+14
Aligning the type parameters of the ifaces, impls, and methods correctly in typeck is almost brain surgery. Seems to work now for everything I threw at it, but might still break in other corner cases. Issue #1227
2012-01-03Add missing ty_constr cases to trans::type_of_inner and ty::fold_ty.Tim Chevalier-0/+6
Closes #970
2012-01-03Wire in resolution of param bounds for method callsMarijn Haverbeke-2/+0
Issue #1227
2012-01-02Key tcx.ty_param_bounds on node_ids, not def_idsMarijn Haverbeke-3/+5
This makes it clearer that it's only valid for local nodes.
2012-01-02Box arrays of parameter boundsMarijn Haverbeke-2/+2
2012-01-02Pass bounds to trans::type_of_fnMarijn Haverbeke-5/+7
2012-01-02More resolving and typechecking of bounded type parameters.Marijn Haverbeke-9/+25
Extern interfaces still don't get recognized. Issue #1227
2012-01-02Check that type parameter bounds are interface typesMarijn Haverbeke-23/+22
Issue #1227
2011-12-29Box ty_param_bounds_and_tyMarijn Haverbeke-1/+1
It contains a vector, which shouldn't be copied all the time.
2011-12-28Move the kind datatype to middle::tyMarijn Haverbeke-19/+49
The AST no longer references it.
2011-12-28Change representation of type params to handle interface boundsMarijn Haverbeke-13/+38
Issue #1227
2011-12-28Made matching machine types equal to float, int, uint (fixes #1376)Stefan Plantikow-1/+22
2011-12-23Check impls methods against the type of their iface.Marijn Haverbeke-20/+35
2011-12-23Parse `iface` items and interface references in `impl` items.Marijn Haverbeke-35/+56
The (temporary) syntax is iface seq<T> { fn len() -> uint; fn iter(f: block(T)); } // The 'blah<T>' can be left of to default the name of the // impl to seq<T>. The 'of seq<T>' can be left off when // not implementing a named interface. impl blah<T> of seq<T> for [T] { fn len() -> uint { vec::len(self) } fn iter(f: block(T)) { for x in self { f(x); } } }
2011-12-23Use the same type of record in ty::ty_fn and ty::methodMarijn Haverbeke-173/+120
Removes some more code duplication.