about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2011-07-06Add a compile-fail test for attempts to extend non-objects.Lindsey Kuper-0/+13
2011-07-06Support paren-free and lightweight-case syntaxMarijn Haverbeke-0/+11
(The old syntax is still supported as well, for now.) It is now possible to leave out the parens around if, while, and do/while conditions, and around alt expressions. Cases in an alt block can now leave off the case keyword and parens around the pattern. After the next snapshot, we can start migrating our code to use the new alt syntax, probably with a pretty-printer pass. The paren-free syntax will remain optional (you may always parenthesize expressions), but the old case syntax will no longer be supported in the future.
2011-07-05Handle pattern-bound upvarsTim Chevalier-0/+24
If a closure inside a case alternative (for example, a for each loop) referenced a pattern-bound variable, this would cause an assertion failure in trans. Changed trans::collect_upvars to handle pattern-bound vars correctly. Incidentally, eliminated all direct uses of option::get in trans.
2011-07-05stdlib: Implement ivec::foldlPatrick Walton-0/+15
2011-07-05Change ast::meta_name_value to accept any literal, not just stringBrian Anderson-0/+14
This isn't useful for much of anything yet, since metadata::encoder doesn't know how to handle the non-string variants. Issue #611
2011-07-05stdlib: Add filter_map to ivecPatrick Walton-0/+23
2011-07-05Require that the meta items in a use statement have unique namesBrian Anderson-0/+7
2011-07-05Handle fail inside a for-each loop properlyTim Chevalier-0/+23
2011-07-05Support conditional compilation of native items. Closes #610Brian Anderson-0/+8
2011-07-05Parse attributes for native items. Closes #609Brian Anderson-0/+12
2011-07-05Error if the link attribute has duplicate items. Issue #614Brian Anderson-0/+7
2011-07-05Add a test file for distinct ty_native typesMarijn Haverbeke-0/+7
This should have gone into patch 77f5d14f14630da997f13de28ea86e8320957180, had I not forgotten to add the file.
2011-07-04stdlib: Add ivec::any() and ivec::all(); put out burning tinderboxPatrick Walton-2/+19
2011-07-04stdlib: Implement interior vector mapPatrick Walton-0/+23
2011-07-04stdlib: Add an inefficient implementation of ivec::popPatrick Walton-0/+23
2011-07-03Make non-str fail expression a type checking failure instead of a ↵Josh Matthews-0/+5
translation one.
2011-07-03Un-XFAIL fail-argTim Chevalier-4/+2
2011-07-03Handle fail as an argument; parse fail expressions unambiguouslyTim Chevalier-0/+9
An expression like: foo(1, fail, 2) was failing to parse, because the parser was interpreting the comma as the start of an expression that was an argument to fail, rather than recognizing that the fail here has no arguments Fixed this by using can_begin_expr to determine whether the next token after a fail token suggests that this is a nullary fail or a unary fail. In addition, when translating calls, check before translating each argument that the block still isn't terminated. This has the effect that if an argument list includes fail, the back-end won't keep trying to generate code for successive arguments and trip the !*terminated assertion.
2011-07-03Manipulate contexts correctly in trans_fail_exprTim Chevalier-0/+9
This fixes Issue #617
2011-07-03XFAILing the new test case...Tim Chevalier-0/+2
...because the parsing of fail got changed out from under me. Will fix shortly.
2011-07-02Generate code properly for calls with _|_ - typed argumentsTim Chevalier-0/+9
The code for translating a fail (for example) would call Unreachable(), which terminates the block; if a fail appeared as an argument, this would cause an LLVM assertion failure. Changed trans_call to handle this situation correctly.
2011-07-02Fix assertion failure when syntax extension name is missing.Josh Matthews-0/+5
2011-07-02Fix the error-pattern on compile-fail/fail-simpleBrian Anderson-1/+1
Recent changes to the fail statement changed the way the parser errors in this scenario.
2011-07-02Allow any string expression to be used with fail.Josh Matthews-3/+8
2011-07-01Add a test for mismatched crate metadata in use statementsBrian Anderson-0/+5
2011-07-01Add tests for newtype-style tagsMarijn Haverbeke-0/+26
2011-07-01Implement autoderef for function calls.Michael Sullivan-0/+18
This is important since we are going to be making functions noncopyable soon, which means we'll be seeing a lot of boxed functions. (*f)(...) is really just too heavyweight. Doing the autodereferencing was a very little bit tricky since trans_call works with an *lval* of the function whereas existing autoderef code was not for lvals.
2011-06-30stdlib: Add an interior vector version of sort and a test casePatrick Walton-0/+28
2011-06-30rustc: Duplicate heap data of interior vectors when passing them by valuePatrick Walton-0/+5
2011-06-30Pretty-print view items in mod itemsBrian Anderson-0/+15
For mods that aren't defined at the file level we were forgetting to print the view items so, e.g. 'mod { use std; }' would not print correctly.
2011-06-30Restore some functionality that got stripped out of the export tests while ↵Graydon Hoare-29/+66
last reformatting.
2011-06-30Conditionally compile items declared as statements. Issue #489Brian Anderson-0/+13
2011-06-30Add more tests for conditional compilation. Issue #489Brian Anderson-1/+67
2011-06-30remove an unused variableTim Chevalier-1/+0
2011-06-30Added a new version of pfib that's better suited for benchmarking the task ↵Eric Holk-0/+79
system. It generates gnuplot output.
2011-06-30Added a nanosecond timer to time.rs, support for some floating point casts, ↵Eric Holk-24/+47
and a commandline-driven mode for pfib.rs
2011-06-30Un-XFAIL run-pass/conditional-compile.rs. Issue #489Brian Anderson-2/+0
2011-06-30Introduce a testcase for conditional compilation via attributesBrian Anderson-0/+10
Issue #489
2011-06-30Support type parameters in resourcesMarijn Haverbeke-0/+13
Some rather dodgy code was added to trans in the process. I'd love to discuss it with someone who knows more about types during translation.
2011-06-29Adding support for pinning tasks to the currently running thread. Closes #598.Eric Holk-0/+15
2011-06-29Re-enable tidy (it was broken) and fix various non-tidy things.Graydon Hoare-13/+13
2011-06-29Add a runtime flag to enable/disable claims en masseTim Chevalier-0/+2
Now, if the environment variable CHECK_CLAIMS is set, then all claims turn into checks. Otherwise, claims are no-ops.
2011-06-29Make tests a little more friendly to combine.Graydon Hoare-5/+8
2011-06-29rustc: Fix a leak that resulted from copying a structural interior type ↵Patrick Walton-0/+10
containing interior vectors. Add a test case.
2011-06-29rt: Remove the lock around upcall_vec_append. Add a test case. Closes #156.Patrick Walton-0/+7
2011-06-28Support attaching attributes to modules via the crate file. Issue #487Brian Anderson-1/+5
2011-06-28rustc: Move duplicate_heap_parts to copy glue; add a test casePatrick Walton-0/+7
2011-06-28Actually notice xfail-stage2 as different from xfail-stage2. Fix affected tests.Graydon Hoare-8/+12
2011-06-28Require that both sides of a swap be lvals.Michael Sullivan-0/+5
2011-06-28Implement "claim"Tim Chevalier-0/+31
Implement "claim" (issue #14), which is a version of "check" that doesn't really do the check at runtime. It's an unsafe feature. The new flag --check-claims turns claims into checks automatically -- but it's off by default, so by default, the assertion in a claim doesn't execute at runtime.