summary refs log tree commit diff
path: root/src/comp/middle
AgeCommit message (Collapse)AuthorLines
2012-01-19Handle predicates that recurse in a check() expressionTim Chevalier-9/+10
typestate was using the enclosing function ID for the "this function returns" constraint, which meant confusion and panic in the case where a predicate p includes "check p()". Fixed it to use a fresh ID. Closes #933
2012-01-19Additional ; to , changes, disable "tag" and ";" in parser. Close #1430. ↵Graydon Hoare-5/+5
Close #1428.
2012-01-19rustc: ";" to "," in enumsPatrick Walton-163/+163
2012-01-19rustc: Remove trailing whitespacePatrick Walton-1/+1
2012-01-19Compute typestates for FRU exprs correctly, plus a bit of cleanupTim Chevalier-50/+36
The code in Issue 948 was causing typestate to diverge because it was using the prestate for the whole expression -- not the post- state for the fields list -- as the prestate for the record base expression. Fixed. Closes #948
2012-01-19Handle log expressions with a _|_-typed levelTim Chevalier-0/+6
If we have log(foo, quux) where foo:_|_, just translate foo and ignore the rest of the expression. Closes #1459
2012-01-19rustc: Fix long linesPatrick Walton-3/+4
2012-01-19rustc: "tag" -> "enum"Patrick Walton-109/+109
2012-01-19In trans, allow _|_-typed things to be the argument to failTim Chevalier-1/+1
Rationale: _|_-typed things diverge, so it's safe to use them in any context. Closes #1465
2012-01-19treat fn*() as fn&()Niko Matsakis-3/+3
This is not my ideal way of going about things. I'd prefer not to have expressions typed as fn*(), for example, but I couldn't get that to work together with inferring the modes of arguments and other corner cases.
2012-01-19rustc: Refactor lint check and avoid a segv faultHaitao Li-19/+7
The segv fault issue is #1566
2012-01-19rustc: Name the lint-style check module `lint`Haitao Li-59/+75
Issue #1543
2012-01-19rustc: Add a usage pass to collect one-off analysesHaitao Li-29/+59
This patch starts from move the analysis which checkes of probably incorrectly usage of `int|uint` in native fn. Issue #1543
2012-01-19Remove support for the '.' after a nullary tag in a patternTim Chevalier-48/+47
(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-724/+724
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-96/+64
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-28/+36
also, streamline type_is_tup_like() to the cases which actually work
2012-01-19rustc: Use integer from ctypes consistentlyHaitao Li-41/+48
2012-01-19Use ctypes in native function declarationsHaitao Li-89/+106
2012-01-19rustc: Warn when int or uint is used in a native type declHaitao Li-0/+29
Issue #1403
2012-01-17use 64-bit memset on 64-bit platforms. Fixes #1546. Fixes #843.Niko Matsakis-22/+12
Actually, we don't "fix" #843 so much as close it: as with memmove, we simply use an alignment of 1 with dynamically sized types.
2012-01-17roll back commit 1c7a62Niko Matsakis-16/+16
2012-01-17Merge pull request #1544 from kevina/issue-1393Graydon Hoare-4/+4
Minor cleanups to custom discriminator code.
2012-01-17encode variant names and have log print them out.Niko Matsakis-3/+16
2012-01-17Allow omission of the '.' after nullary tag patternsTim Chevalier-127/+327
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-17Use a memset upcall to zero things without static alignmentMarijn Haverbeke-16/+16
This fixes issues #843 and #1546. The cost of an upcall is unfortunate, though. I assume there must be a way to simply manually compute the pointer or size, using something akin to the formula in `align_to` in `rust_util.h`. I could not get this to work, unfortunately.
2012-01-16Minor cleanups to custom discriminator code.Kevin Atkinson-4/+4
Mostly updates to the comments and docs from Pull Request #1537.
2012-01-16Remove misguided indirect return in trans_closureMarijn Haverbeke-8/+4
Closes #1528
2012-01-16Store type names in crate metadataMarijn Haverbeke-1/+6
Improves type error messages referring to external types. Issue #1507
2012-01-16Don't evaluate discriminator value constants when parsing.Kevin Atkinson-5/+84
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-13Undo over-enthusiastic obj system removal in debuginfo.Josh Matthews-0/+3
2012-01-13llvm: Switch back to LLVM trunkBrian Anderson-1/+1
2012-01-13distinguish "any closure" and "stack closure" (block)Niko Matsakis-15/+29
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-47/+49
2012-01-13Obj system? What obj system?Marijn Haverbeke-1690/+128
Removes the obj system from the compiler. Closes #1484
2012-01-13Remove all remaining uses of objs from the compilerMarijn Haverbeke-31/+32
2012-01-12Add type parameters when checking wildcard patternsTim Chevalier-1/+12
For some reason, wildcard patterns were never getting type parameter substitutions attached. This would cause an assertion failure when checking a wildcard pattern that matches against a tag with polymorphic type (not sure why this didn't come up before). Fixed it. (The diff and test case may be easier to understand than this note :P) Closes #1503.
2012-01-12add tydescs into shape, rewrite walk_fn_contents()Niko Matsakis-14/+5
2012-01-12free uniq data we encounter on the sweep, walk thru them otherwiseNiko Matsakis-5/+29
2012-01-12Make driver::session::session no longer an objectMarijn Haverbeke-76/+99
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-12Implement passing cast-to-vtable values as bounded paramsMarijn Haverbeke-76/+155
Closes #1492
2012-01-12Cleanups to previous commits for issue #1393.Kevin Atkinson-5/+5
2012-01-11Fix dependency bug iface-did-of-impl resolvingMarijn Haverbeke-9/+10
By simply not resolving that def id until the typeck pass. Closes #1494
2012-01-11Implement std::map as an iface/impl instead of an objMarijn Haverbeke-82/+8
2012-01-11Fix regression in resolving of external implsMarijn Haverbeke-5/+8
2012-01-11Pass type with params intact as item_type for method calleesMarijn Haverbeke-7/+6
This prevents trans_args from optimizing out nil return types. The method might be generic, in which case it *will* write to a nil retptr.
2012-01-10Add support for casting enum-like tags to scalar values.Kevin Atkinson-5/+48
2012-01-10Support explicit discriminant numbers on tag variants.Kevin Atkinson-25/+18
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-10replace lambda with fn@Niko Matsakis-15/+10