summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2014-06-27Update to 0.11.0 0.11.0Alex Crichton-1/+1
2014-06-27Add test for #11677Piotr Jawniak-0/+24
This code used to cause an ICE Closes #11677
2014-06-26auto merge of #14886 : alexcrichton/rust/rt-improvements, r=brsonbors-0/+53
Most of the comments are available on the Task structure itself, but this commit is aimed at making FFI-style usage of Rust tasks a little nicer. Primarily, this commit enables re-use of tasks across multiple invocations. The method `run` will no longer unconditionally destroy the task itself. Rather, the task will be internally re-usable if the closure specified did not fail. Once a task has failed once it is considered poisoned and it can never be used again. Along the way I tried to document shortcomings of the current method of tearing down a task, opening a few issues as well. For now none of the behavior is a showstopper, but it's useful to acknowledge it. Also along the way I attempted to remove as much `unsafe` code as possible, opting for safer abstractions.
2014-06-26rustrt: Reorganize task usageAlex Crichton-0/+53
Most of the comments are available on the Task structure itself, but this commit is aimed at making FFI-style usage of Rust tasks a little nicer. Primarily, this commit enables re-use of tasks across multiple invocations. The method `run` will no longer unconditionally destroy the task itself. Rather, the task will be internally re-usable if the closure specified did not fail. Once a task has failed once it is considered poisoned and it can never be used again. Along the way I tried to document shortcomings of the current method of tearing down a task, opening a few issues as well. For now none of the behavior is a showstopper, but it's useful to acknowledge it. Also along the way I attempted to remove as much `unsafe` code as possible, opting for safer abstractions.
2014-06-26Remove unnecessary to_string callsPiotr Jawniak-1/+1
This commit removes superfluous to_string calls from various places
2014-06-26auto merge of #15184 : jbclements/rust/for-loop-hygiene-etc, r=jbclementsbors-0/+38
It turns out that bindings introduced by 'for' loops were not treated hygienically. The fix for this is to make the 'for' expansion more like a macro; rather than expanding sub-pieces and then assembling them, we need to rewrite the for and then call expand again on the whole thing. This PR includes a test and the fix. It also contains a number of other things: - unit tests for other forms of hygiene (currently ignored) - a fix for the isaac.rs macro that (it turned out) was relying on capturing - other miscellaneous cleanup and comments
2014-06-25work around 15189 in test casesJohn Clements-0/+38
2014-06-24librustc: Remove cross borrowing from mutable `Box`es to `&mut`.Patrick Walton-2/+2
This will break code like: fn f(x: &mut int) {} let mut a = box 1i; f(a); Change it to: fn f(x: &mut int) {} let mut a = box 1i; f(&mut *a); RFC 33; issue #10504. [breaking-change]
2014-06-25auto merge of #15160 : alexcrichton/rust/remove-f128, r=brsonbors-21/+0
The f128 type has very little support in the compiler and the feature is basically unusable today. Supporting half-baked features in the compiler can be detrimental to the long-term development of the compiler, and hence this feature is being removed.
2014-06-24Test fixes from the rollupAlex Crichton-2/+0
Closes #14482 (std: Bring back half of Add on String) Closes #15026 (librustc: Remove the fallback to `int` from typechecking.) Closes #15119 (Add more description to c_str::unwrap().) Closes #15120 (Add tests for #12470 and #14285) Closes #15122 (Remove the cheat sheet.) Closes #15126 (rustc: Always include the morestack library) Closes #15127 (Improve ambiguous pronoun.) Closes #15130 (Fix #15129) Closes #15131 (Add the Guide, add warning to tutorial.) Closes #15134 (Xfailed tests for hygiene, etc.) Closes #15135 (core: Add stability attributes to Clone) Closes #15136 (Some minor improvements to core::bool) Closes #15137 (std: Add stability attributes to primitive numeric modules) Closes #15141 (Fix grammar in tutorial) Closes #15143 (Remove few FIXMEs) Closes #15145 (Avoid unnecessary temporary on assignments) Closes #15147 (Small improvements for metaprogramming) Closes #15153 (librustc: Check function argument patterns for legality of by-move) Closes #15154 (test: Add a test for regions, traits, and variance.) Closes #15159 (rustc: Don't register syntax crates twice) Closes #13816 (Stabilize version output for rustc and rustdoc)
2014-06-24rustc: Don't register syntax crates twiceAlex Crichton-0/+15
We only need to register them once, and once they're registered twice warnings will start being spewed or worse may happen! Closes #14330
2014-06-24Remove few FIXMEsPiotr Jawniak-8/+3
This commit removes FIXMEs of few closed issues. Closes #13992
2014-06-24Move core::bool tests to run-passBrian Anderson-0/+77
These are closer to language tests than library.
2014-06-24added xfailed test for issue 9737John Clements-0/+20
2014-06-24added xfailed tests for two other flavors of var hygieneJohn Clements-0/+47
2014-06-24Fix #15129Jakub Wieczorek-0/+33
Add support for unit literals to const_eval.
2014-06-24rustc: Always include the morestack libraryAlex Crichton-0/+13
It was previously assumed that the object file generated by LLVM would always require the __morestack function, but that assumption appears to be incorrect, as outlined in #15108. This commit forcibly tells the linker to include the entire archive, regardless of whether it's currently necessary or not. Closes #15108
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-498/+505
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-24Remove the quad_precision_float feature gateAlex Crichton-21/+0
The f128 type has very little support in the compiler and the feature is basically unusable today. Supporting half-baked features in the compiler can be detrimental to the long-term development of the compiler, and hence this feature is being removed.
2014-06-24auto merge of #15118 : stepancheg/rust/concat, r=alexcrichtonbors-1/+3
(And in other extensions implemented with `get_exprs_from_tts` function).
2014-06-24auto merge of #15113 : ↵bors-0/+40
pnkfelix/rust/fsk-add-regression-test-for-ice-from-10846, r=alexcrichton Includes a bit more comments than usual for a regression test; I felt like documenting Niko's diagnosis of the original problem here. Fix #15111 r? anyone.
2014-06-23librustc: Feature gate lang items and intrinsics.Patrick Walton-2/+14
If you define lang items in your crate, add `#[feature(lang_items)]`. If you define intrinsics (`extern "rust-intrinsic"`), add `#[feature(intrinsics)]`. Closes #12858. [breaking-change]
2014-06-24auto merge of #14952 : alexcrichton/rust/const-unsafe-pointers, r=brsonbors-0/+14
This does not yet change the compiler and libraries from `*T` to `*const T` as it will require a snapshot to do so. cc #7362 --- Note that the corresponding RFC, https://github.com/rust-lang/rfcs/pull/68, has not yet been accepted. It was [discussed at the last meeting](https://github.com/rust-lang/rust/wiki/Meeting-weekly-2014-06-10#rfc-pr-68-unsafe-pointers-rename-t-to-const-t) and decided to be accepted, however. I figured I'd get started on the preliminary work for the RFC that will be required regardless.
2014-06-23libsyntax: Disallow struct literals after `if`, `while`, `match`, andPatrick Walton-5/+5
`for...in`. Closes #14803. If you used a structure literal after one of these keywords, surround it in parentheses. [breaking-change]
2014-06-23auto merge of #15106 : Sawyer47/rust/rm-duplicated-tests, r=alexcrichtonbors-15/+4
Even if they used to test different things in the past, they are now identical to other files. Closes #11496
2014-06-23Allow trailing comma in `concat!`Stepan Koltsov-1/+3
(And in other extensions implemented with `get_exprs_from_tts` function).
2014-06-23Add regression test for ICE from issue 10846.Felix S. Klock II-0/+40
2014-06-23auto merge of #15086 : jakub-/rust/xc-struct-variants-match, r=alexcrichtonbors-2/+24
Turns out field names of struct variants are not encoded in crate metadata.
2014-06-22auto merge of #15081 : jakub-/rust/issue-15080, r=alexcrichtonbors-0/+38
Fixes #15080.
2014-06-22Remove duplicated test filesPiotr Jawniak-15/+4
Even if they used to test different things in the past, they are now identical to other files. Closes #11496
2014-06-21Fix spurious non-exhaustive errors for cross-crate struct variantsJakub Wieczorek-2/+24
2014-06-21Fix a #14731 regression in missing_constructor() for vector patternsJakub Wieczorek-0/+38
Fixes #15080.
2014-06-21Add missing attributes to indirect calls for foreign functionsBjörn Steinbrink-0/+36
When calling a foreign function, some arguments and/or return value attributes are required to conform to the foreign ABI. Currently those attributes are only added to the declaration of foreign functions. With direct calls, this is no problem, because LLVM can see that those attributes apply to the call. But with an indirect call, LLVM cannot do that and the attribute is missing. To fix that, we have to add those attribute to the calls to foreign functions as well. This also allows to remove the special handling of the SRet attribute, which is ABI-dependent and will be set via the `attr` field of the return type's `ArgType`.
2014-06-21auto merge of #15062 : pcwalton/rust/trailing-plus, r=brsonbors-12/+7
This will break code that looks like `Box<Trait+>`. Change that code to `Box<Trait>` instead. Closes #14925. [breaking-change] r? @brson
2014-06-21auto merge of #14731 : jakub-/rust/pattern-matching-refactor, r=alexcrichtonbors-0/+55
This PR is changing the error messages for non-exhaustive pattern matching to include a more accurate witness, i.e. a pattern that is not covered by any of the ones provided by the user. Example: ```rust fn main() { match (true, (Some("foo"), [true, true]), Some(42u)) { (false, _, _) => (), (true, (None, [true, _]), None) => (), (true, (None, [false, _]), Some(1u)) => () } } ``` ```sh /tmp/witness.rs:2:2: 6:3 error: non-exhaustive patterns: (true, (core::option::Some(_), _), _) not covered /tmp/witness.rs:2 match (true, (Some("foo"), [true, true]), Some(42u)) { /tmp/witness.rs:3 (false, _, _) => (), /tmp/witness.rs:4 (true, (None, [true, _]), None) => (), /tmp/witness.rs:5 (true, (None, [false, _]), Some(1u)) => () /tmp/witness.rs:6 } ``` As part of that, I refactored some of the relevant code and carried over the changes to fixed vectors from the previous PR. I'm putting it out there for now but the tests will be red.
2014-06-20libsyntax: Stop parsing `+` with no bounds after it.Patrick Walton-12/+7
This will break code that looks like `Box<Trait+>`. Change that code to `Box<Trait>` instead. Closes #14925. [breaking-change]
2014-06-20auto merge of #14988 : pcwalton/rust/unsafe-destructor-feature-gate, ↵bors-11/+19
r=alexcrichton Closes #8142. This is not the semantics we want long-term. You can continue to use `#[unsafe_destructor]`, but you'll need to add `#![feature(unsafe_destructor)]` to the crate attributes. [breaking-change] r? @alexcrichton
2014-06-20librustc: Put `#[unsafe_destructor]` behind a feature gate.Patrick Walton-11/+19
Closes #8142. This is not the semantics we want long-term. You can continue to use `#[unsafe_destructor]`, but you'll need to add `#![feature(unsafe_destructor)]` to the crate attributes. [breaking-change]
2014-06-20Ignore issue-14393 on WindowsJakub Wieczorek-0/+2
2014-06-20syntax: Parse GT tokens from `>=` and `>>=`Alex Crichton-0/+21
The parser already has special logic for parsing `>` tokens from `>>`, and this commit extends the logic to the acquiring a `>` from the `>=` and `>>=` tokens as well. Closes #15043
2014-06-20Address review commentsJakub Wieczorek-0/+6
2014-06-20Fix #14393Jakub Wieczorek-0/+17
String patterns should have a single constructor of arity 0.
2014-06-20Add support for fixed size vectors in let/arg patternsJakub Wieczorek-0/+30
Fixes #7784
2014-06-19auto merge of #15033 : Sawyer47/rust/old-test, r=alexcrichtonbors-30/+0
This test was added long time ago and marked as ignored. The same test was added later in #8485 as run-fail/issue-3907.rs, but the old one was not deleted.
2014-06-19auto merge of #14830 : luqmana/rust/cmtrttcbctto, r=nikomatsakisbors-0/+41
Fixes #14399.
2014-06-19auto merge of #14400 : kballard/rust/lexer_crlf_handling, r=cmrbors-0/+45
The lexer already ignores CRLF in between tokens, but it doesn't properly handle carriage returns inside strings and doc comments. Teach it to treat CRLF as LF inside these tokens, and to disallow carriage returns that are not followed by linefeeds. This includes handling an escaped CRLF inside a regular string token the same way it handles an escaped LF. This is technically a breaking change, as bare carriage returns are no longer allowed, and CRLF sequences are now treated as LF inside strings and doc comments, but it's very unlikely to actually affect any real-world code. This change is necessary to have Rust code compile on Windows the same way it does on Unix. The mozilla/rust repository explicitly sets eol=lf for Rust source files, but other Rust repositories don't. Notably, rust-http cannot be compiled on Windows without converting the CRLF line endings back to LF. [breaking-change]
2014-06-18Handle CRLF properly in the lexerKevin Ballard-0/+45
The lexer already ignores CRLF in between tokens, but it doesn't properly handle carriage returns inside strings and doc comments. Teach it to treat CRLF as LF inside these tokens, and to disallow carriage returns that are not followed by linefeeds. This includes handling an escaped CRLF inside a regular string token the same way it handles an escaped LF. This is technically a breaking change, as bare carriage returns are no longer allowed, and CRLF sequences are now treated as LF inside strings and doc comments, but it's very unlikely to actually affect any real-world code. This change is necessary to have Rust code compile on Windows the same way it does on Unix. The mozilla/rust repository explicitly sets eol=lf for Rust source files, but other Rust repositories don't. Notably, rust-http cannot be compiled on Windows without converting the CRLF line endings back to LF. [breaking-change]
2014-06-18Deprecate the bytes!() macro.Simon Sapin-3/+3
Replace its usage with byte string literals, except in `bytes!()` tests. Also add a new snapshot, to be able to use the new b"foo" syntax. The src/etc/2014-06-rewrite-bytes-macros.py script automatically rewrites `bytes!()` invocations into byte string literals. Pass it filenames as arguments to generate a diff that you can inspect, or `--apply` followed by filenames to apply the changes in place. Diffs can be piped into `tip` or `pygmentize -l diff` for coloring.
2014-06-18Fix #14865Edward Wang-0/+30
Fixes a codegen bug which generates illegal non-terminated LLVM block when there are wildcard pattern with guard and enum patterns in a match expression. Also refactors the code a little. Closes #14865
2014-06-18Fallout from TaskBuilder changesAaron Turon-34/+17
This commit brings code downstream of libstd up to date with the new TaskBuilder API.