about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2013-08-19Add tests for cross-crate condition handling. Close #5446.Graydon Hoare-0/+215
2013-08-19test: add testcase, close #4929 which was already fixed.Graydon Hoare-0/+12
2013-08-19test: un-xfail now working run-pass/foreign-struct.rs, close #2334.Graydon Hoare-1/+0
2013-08-19auto merge of #8535 : nikomatsakis/rust/issue-3678-wrappers-be-gone-2, r=graydonbors-14/+46
Long-standing branch to remove foreign function wrappers altogether. Calls to C functions are done "in place" with no stack manipulation; the scheme relies entirely on the correct use of `#[fixed_stack_segment]` to guarantee adequate stack space. A linter is added to detect when `#[fixed_stack_segment]` annotations are missing. An `externfn!` macro is added to make it easier to declare foreign fns and wrappers in one go: this macro may need some refinement, though, for example it might be good to be able to declare a group of foreign fns. I leave that for future work (hopefully somebody else's work :) ). Fixes #3678.
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-3/+40
2013-08-19Issue #3678: Remove wrappers and call foreign functions directlyNiko Matsakis-11/+6
2013-08-19auto merge of #8564 : alexcrichton/rust/ifmt+++, r=graydonbors-5/+27
See discussion in #8489, but this selects option 3 by adding a `Default` trait to be implemented by various basic types. Once this makes it into a snapshot I think it's about time to start overhauling all current use-cases of `fmt!` to move towards `ifmt!`. The goal is to replace `%X` with `{}` in 90% of situations, and this commit should enable that.
2013-08-18auto merge of #8556 : sfackler/rust/quote, r=alexcrichtonbors-23/+23
They previously required one called "ext_cx" to be in scope. Fixes part of #7727
2013-08-18auto merge of #8561 : kballard/rust/do-block-internal-err-msg, r=thestingerbors-41/+0
When using a `do` block to call an internal iterator, if you forgot to return a value from the body, it would tell you error: Do-block body must return bool, but returns () here. Perhaps you meant to write a `for`-loop? This advice no longer applies as `for` loops are now for external iterators. Delete this message outright and let it use the default error message error: mismatched types: expected `bool` but found `()` r? @thestinger
2013-08-18auto merge of #8560 : kballard/rust/reserve-yield, r=pcwaltonbors-22/+22
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-18quote_*! macros take an ExtCtxSteven Fackler-23/+23
They previously required one called "ext_cx" to be in scope. Fixes part of #7727
2013-08-18auto merge of #8551 : huonw/rust/speling, r=alexcrichtonbors-2/+2
(This doesn't add/remove `u`s or change `ize` to `ise`, or anything like that.)
2013-08-17auto merge of #8547 : kballard/rust/trait-parse-err-msg, r=alexcrichtonbors-0/+13
When parsing a trait function, the function must end with either `;` or `{` (signifying a default implementation). The error message incorrectly stated that it must be `;` or `}`. Fixes #6610.
2013-08-17auto merge of #8544 : dim-an/rust/fix-match-pipes, r=pcwaltonbors-0/+68
Pointers to bound variables shouldn't be stored before checking pattern, otherwise piped patterns can conflict with each other (issue #6338). Closes #6338.
2013-08-17auto merge of #8554 : michaelwoerister/rust/generics, r=brsonbors-11/+1880
This pull request includes support for generic functions and self arguments in methods, and combinations thereof. This also encompasses any kind of trait methods, regular and static, with and without default implementation. The implementation is backed up by a felt ton of test cases `:)` This is a very important step towards being able to compile larger programs with debug info, since practically any generic function caused an ICE before. One point worth discussing is that activating debug info now automatically (and silently) sets the `no_monomorphic_collapse` flag. Otherwise debug info would show wrong type names in all but one instance of the monomorphized function. Another thing to note is that the handling of generic types does not strictly follow the DWARF specification. That is, variables with type `T` (where `T=int`) are described as having type `int` and not as having type `T`. In other words, we are losing information whether a variable has been declared with a type parameter as its type. In practice this should not make much of difference though since the concrete type is mostly what one is interested in. I'll post an issue later so this won't be forgotten. Also included are a number of bug fixes: * Closes #1758 * Closes #8513 * Closes #8443 * Fixes handling of field names in tuple structs * Fixes and re-enables test case for option-like enums that relied on undefined behavior before * Closes #1339 (should have been closed a while ago) Cheers, Michael
2013-08-17Fix warnings it testsErick Tryzelaar-581/+701
2013-08-16Delegate `{}` to Default instead of PolyAlex Crichton-5/+25
By using a separate trait this is overridable on a per-type basis and makes room for the possibility of even more arguments passed in for the future.
2013-08-16Implement `{:s}` for ~str and @str as wellAlex Crichton-0/+2
2013-08-16Remove obsolete error message regarding do-blocks with internal itersKevin Ballard-41/+0
When using a `do` block to call an internal iterator, if you forgot to return a value from the body, it would tell you error: Do-block body must return bool, but returns () here. Perhaps you meant to write a `for`-loop? This advice no longer applies as `for` loops are now for external iterators. Delete this message outright and let it use the default error message error: mismatched types: expected `bool` but found `()`
2013-08-16debuginfo: Added test cases for static struct and enum methods.Michael Woerister-0/+134
2013-08-16debuginfo: Test cases for [generic][default][static] methods and functions:Michael Woerister-1/+635
* closure-in-generic-function * generic-functions-nested * generic-method-on-generic-struct * generic-trait-generic-static-default-method * method-on-generic-struct * self-in-generic-default-method * trait-generic-static-default-method Also, fixed an 'unused variable' warning in debuginfo.rs
2013-08-16debuginfo: Add test case for issue #8513.Michael Woerister-0/+20
2013-08-16debuginfo: Implemented support for Self type parameter in trait methods with ↵Michael Woerister-0/+141
default implementation.
2013-08-16debuginfo: Added test cases for methods on structs, enums, traits, and ↵Michael Woerister-0/+663
tuple-structs. Also new test cases for tuple structs and by-value parameter passing.
2013-08-16debuginfo: Added test cases for generic structs and enums.Michael Woerister-1/+198
Also, always set no_monomorphic_collapse flags if debuginfo is generated.
2013-08-16debuginfo: Properly handle monomorphization of generic functions.Michael Woerister-1/+16
2013-08-16debuginfo: Generate template type parameters for generic functions.Michael Woerister-0/+48
Conflicts: src/librustc/lib/llvm.rs src/librustc/middle/trans/debuginfo.rs src/rustllvm/RustWrapper.cpp src/rustllvm/rustllvm.def.in
2013-08-16debuginfo: Fixed option-like-enum test case so it does not rely on undefined ↵Michael Woerister-11/+28
behavior.
2013-08-16Reserve 'yield' keywordKevin Ballard-22/+22
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-16auto merge of #8534 : huonw/rust/tls-key-macro, r=alexcrichtonbors-1/+51
This allows the internal implementation details of the TLS keys to be changed without requiring the update of all the users. (Or, applying changes that *have* to be applied for the keys to work correctly, e.g. forcing LLVM to not merge these constants.)
2013-08-16auto merge of #8532 : kballard/rust/cstr-cleanup, r=ericktbors-3/+3
Implement interior null checking in `.to_c_str()`, among other changes.
2013-08-15auto merge of #8518 : catamorphism/rust/issue-8498-workaround, r=brsonbors-0/+44
r? @brson
2013-08-16doc: convert remaining uses of core:: to std::.Huon Wilson-2/+2
2013-08-16syntax: add a local_data_key macro that creates a key for access to the TLS.Huon Wilson-1/+51
This allows the internal implementation details of the TLS keys to be changed without requiring the update of all the users. (Or, applying changes that have to be applied for the keys to work correctly, e.g. forcing LLVM to not merge these constants.)
2013-08-15auto merge of #7917 : catamorphism/rust/resolve-and-testcases, r=catamorphismbors-0/+44
2013-08-15testsuite: xfailed test casesTim Chevalier-0/+44
2013-08-15rm obsolete testDaniel Micay-44/+0
2013-08-15vec: rm obsolete zip and zip_sliceDaniel Micay-44/+0
These are obsoleted by the generic iterator `zip` adaptor. Unlike these, it does not clone the elements or allocate a new vector by default.
2013-08-15Fix error message when trait method ends with wrong tokenKevin Ballard-0/+13
When parsing a trait function, the function must end with either `;` or `{` (signifying a default implementation). The error message incorrectly stated that it must be `;` or `}`. Fixes #6610.
2013-08-15auto merge of #8485 : alexcrichton/rust/add-tests, r=catamorphismbors-0/+445
Closes #3907 Closes #5493 Closes #4464 Closes #4759 Closes #5666 Closes #5884 Closes #5926 Closes #6318 Closes #6557 Closes #6898 Closes #6919 Closes #7222
2013-08-16Pointers to bound variables are stored after all patterns are matched.Dmitry Ermolov-2/+0
Pointers to bound variables shouldn't be stored before checking pattern, otherwise piped patterns can conflict with each other (issue #6338). Closes #6338.
2013-08-15Add even more testsAlex Crichton-0/+105
Closes #8248 Closes #8249 Closes #8398 Closes #8401
2013-08-15Fix a typo in the ifmt doxAlex Crichton-5/+5
2013-08-16Test for issue #6338.Dmitry Ermolov-0/+70
2013-08-15Add ToCStr method .with_c_str()Kevin Ballard-3/+3
.with_c_str() is a replacement for the old .as_c_str(), to avoid unnecessary boilerplate. Replace all usages of .to_c_str().with_ref() with .with_c_str().
2013-08-15auto merge of #8483 : luqmana/rust/rexprs, r=catamorphismbors-0/+31
Fixes #8152.
2013-08-14testsuite: Add xfailed test for #8498Tim Chevalier-0/+44
2013-08-14rustc: Eliminate a derived error in check::_matchTim Chevalier-2/+29
2013-08-14auto merge of #8440 : sfackler/rust/env-fix, r=pcwaltonbors-2/+1
The type of the result of option_env! was not fully specified in the None case, leading to type check failures in the case where the variable was not defined (e.g. option_env!("FOO").is_none()). Also cleaned up some compilation warnings.
2013-08-13auto merge of #8477 : catamorphism/rust/issue-4096, r=msullivanbors-0/+22
r? @msullivan ...e parameters In this case, it's likely to be that the user forgot the `self` type, so say so. Closes #4096