summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2014-06-27Update to 0.11.0 0.11.0Alex Crichton-5/+5
2014-06-27Add test for #11677Piotr Jawniak-0/+24
This code used to cause an ICE Closes #11677
2014-06-26librustc: Ensure that proc upvars have static lifetime.Patrick Walton-0/+26
Since procs do not have lifetime bounds, we must do this to maintain safety. This can break code that incorrectly captured references in procedure types. Change such code to not do this, perhaps with a trait object instead. A better solution would be to add higher-rank lifetime support to procs. However, this would be a lot of work for a feature we want to remove in favor of unboxed closures. The corresponding "real fix" is #15067. Closes #14036. [breaking-change]
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-2/+2
This commit removes superfluous to_string calls from various places
2014-06-26auto merge of #15184 : jbclements/rust/for-loop-hygiene-etc, r=jbclementsbors-13/+80
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-25more loops to be ignored by pretty-rpassJohn Clements-0/+8
2014-06-25work around 15189 in test casesJohn Clements-0/+38
2014-06-25added compile-fail test for 15167John Clements-0/+21
2014-06-25tidy macro just a bitJohn Clements-13/+13
2014-06-25auto merge of #15171 : pcwalton/rust/remove-cross-borrowing, r=brsonbors-21/+36
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] r? @brson
2014-06-24librustc: Don't try to perform the magicalPatrick Walton-0/+31
vector-reference-to-unsafe-pointer-to-element cast if the type to be casted to is not fully specified. This is a conservative change to fix the user-visible symptoms of the issue. A more flexible treatment would delay cast checks to after function typechecking. This can break code that did: let x: *u8 = &([0, 0]) as *_; Change this code to: let x: *u8 = &([0, 0]) as *u8; Closes #14893. [breaking-change]
2014-06-24librustc: Remove cross borrowing from mutable `Box`es to `&mut`.Patrick Walton-21/+36
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-7/+9
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-24Stabilize version output for rustc and rustdocRobert Buonpastore-0/+8
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-24test: Add a test for regions, traits, and variance.Patrick Walton-0/+52
Closes #12470.
2014-06-24librustc: Check function argument patterns for legality of by-movePatrick Walton-0/+21
bindings. This will break code that incorrectly did things like: fn f(a @ box b: Box<String>) {} Fix such code to not rely on undefined behavior. Closes #12534. [breaking-change]
2014-06-24Remove few FIXMEsPiotr Jawniak-19/+7
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-5/+74
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-24Add tests for #12470 and #14285Edward Wang-0/+67
The #14869 removed `TraitStore` from `ty_trait` and represented trait reference as regular `ty_rptr`. An old bug of the missing constraint upon lifetime parameter of trait reference then is fixed as a side effect. Adds tests for affected bugs and closes them. Closes #12470. Closes #14285.
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-602/+595
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 #15024 : kmcallister/rust/lint, r=alexcrichtonbors-0/+223
This is a rebase of #14804 with two new commits on top to implement and test lint plugins. r? @alexcrichton @huonw: Can you take a look at the new commits, and also weigh in about any issues from the old PR that you feel are still unresolved? I'm leaving the old branch alone to preserve discussion history.
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-24Test lint pluginsKeegan McAllister-0/+223
2014-06-24auto merge of #15114 : ben0x539/rust/run-make-libpath, r=alexcrichtonbors-2/+2
It was accidentally removed in #15006 and that somehow got past the build bots, causing `src/test/run-make/c-dynamic-dylib` to fail on at least my linux system. This resolves #15103 (thanks to @alexcrichton!).
2014-06-24auto merge of #15071 : tomjakubowski/rust/fix-15052, r=alexcrichtonbors-0/+48
Fix #15052
2014-06-24librustc: Remove outdated reference to `~` and `@`Tom Jakubowski-0/+48
Fix #15052
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-3/+45
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-24auto merge of #14885 : pcwalton/rust/struct-literal-tightening, r=alexcrichtonbors-19/+127
`for...in`. Closes #14803. If you used a structure literal after one of these keywords, surround it in parentheses. [breaking-change] r? @nick29581
2014-06-23libsyntax: Disallow struct literals after `if`, `while`, `match`, andPatrick Walton-19/+127
`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 #14974 : Ryman/rust/non_trait_method, r=alexcrichtonbors-10/+49
Closes #3973.
2014-06-23rustc: catch `impl X for Y` where X is not a trait in resolve.Kevin Butler-5/+40
2014-06-23rustc: catch non-trait methods before typeck.Kevin Butler-7/+11
Closes #3973.
2014-06-23auto merge of #15106 : Sawyer47/rust/rm-duplicated-tests, r=alexcrichtonbors-81/+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-23auto merge of #15098 : ben0x539/rust/nullary-tuple-struct, r=pcwaltonbors-1/+14
Reject `struct Foo();` to fix #15095.
2014-06-23Add regression test for ICE from issue 10846.Felix S. Klock II-0/+40
2014-06-23test: readd TMPDIR to LD_LIBRARY_PATH for run-makeBenjamin Herr-2/+2
It was accidentally removed in #15006 and that somehow got past the build bots, causing `src/test/run-make/c-dynamic-dylib` to fail on at least my linux system. This resolves #15103 (thanks to @alexcrichton!).
2014-06-23auto merge of #15086 : jakub-/rust/xc-struct-variants-match, r=alexcrichtonbors-3/+26
Turns out field names of struct variants are not encoded in crate metadata.
2014-06-23auto merge of #15083 : edwardw/rust/destructure-trait-ref, r=pcwaltonbors-1/+42
Closes #15031.