Commit Graph

22253 Commits

Author SHA1 Message Date
bors
0dbd509e0f auto merge of #9199 : thestinger/rust/range_step, r=cmr
My focus was on getting these to be correct in all cases by handling overflow properly. I'll clean them up and work on the performance later.
2013-09-14 17:10:51 -07:00
Daniel Micay
a18038f3b2 iter: add RangeStep and RangeStepInclusive 2013-09-14 18:26:21 -04:00
bors
cf7e93ff25 auto merge of #9198 : FlaPer87/rust/shared-port, r=cmr
SharedPort implementation was missing in std::comm. Since this module
also wraps SharedChan, it makes sense to have SharedPort defined there
as well.
2013-09-14 15:20:50 -07:00
bors
5c4f65e6f5 auto merge of #9191 : huonw/rust/are-you-tired, r=cmr
Allows `std::rt::io::timer::sleep(1000)` rather than `std::rt::io::timer::Timer::new().unwrap().sleep(1000)`.
2013-09-14 14:05:51 -07:00
Daniel Micay
3aead52586 iter: move Counter impl to the proper place 2013-09-14 16:51:55 -04:00
Daniel Micay
10c8978edb iter: replace comment with a docstring 2013-09-14 16:51:33 -04:00
Flavio Percoco
9357f8f4cd Add SharedPort wrapper around rt::comm::SharedPort
SharedPort implementation was missing in std::comm. Since this module
also wraps SharedChan, it makes sense to have SharedPort defined there
as well.
2013-09-14 22:50:28 +02:00
Daniel Micay
561f1b0063 iter: fix range docstrings 2013-09-14 16:33:19 -04:00
bors
524c190565 auto merge of #9183 : alexcrichton/rust/issue-5794, r=catamorphism
Closes #5794
2013-09-14 12:30:54 -07:00
bors
bca015d9ff auto merge of #9182 : bjz/rust/master, r=brson
Somehow this was missed!

cc #4819
2013-09-14 11:15:54 -07:00
bors
5f2f952dbc auto merge of #9181 : lkuper/rust/libsyntax-default-methods-refactor, r=alexcrichton
I'm getting the three `make check` failures mentioned in issue #9127, which I also get building master.
2013-09-14 10:05:51 -07:00
bors
1c26513ef9 auto merge of #9180 : blake2-ppc/rust/reduce-either, r=catamorphism
Work a bit towards #9157 "Remove Either". These instances don't need to use Either and are better expressed in other ways (removing allocations and simplifying types).
2013-09-14 08:50:50 -07:00
bors
5d905f1314 auto merge of #9178 : lkuper/rust/docs, r=catamorphism 2013-09-14 07:30:54 -07:00
Huon Wilson
f39ab75a78 std::rt: Add a standalone sleep function. 2013-09-15 00:20:48 +10:00
bors
9792ec6da7 auto merge of #9174 : thestinger/rust/bot, r=catamorphism
An expression such as `bottom == not_bottom` or `not_bottom == bottom`
already compiled, but this fixes the case where both sides are `bottom`.
2013-09-14 06:15:52 -07:00
bors
55b43fa26e auto merge of #9165 : klutzy/rust/newrt-file-fix, r=sanxiyn
It was broken on win32 because of header inconsistency.
2013-09-14 05:00:56 -07:00
bors
3d469c25e5 auto merge of #9162 : alexcrichton/rust/issue-9123, r=catamorphism
Closes #9123
2013-09-14 03:45:56 -07:00
bors
f853f0b2d6 auto merge of #9160 : alexcrichton/rust/local-data-docs, r=huonw
Remove references to local_data::Key and only mention the macro for how to
construct new keys into local data.
2013-09-14 02:30:59 -07:00
bors
fbafb41fff auto merge of #9156 : sfackler/rust/buffered-fix, r=huonw
This is a workaround for #9155. Currently, any uses of BufferedStream
outside of libstd ICE.
2013-09-14 01:16:00 -07:00
bors
2aa578efd9 auto merge of #9115 : erickt/rust/master, r=erickt
This is a series of patches to modernize option and result. The highlights are:

* rename `.unwrap_or_default(value)` and etc to `.unwrap_or(value)`
* add `.unwrap_or_default()` that uses the `Default` trait
* add `Default` implementations for vecs, HashMap, Option
* add  `Option.and(T) -> Option<T>`, `Option.and_then(&fn() -> Option<T>) -> Option<T>`, `Option.or(T) -> Option<T>`, and `Option.or_else(&fn() -> Option<T>) -> Option<T>`
* add `option::ToOption`, `option::IntoOption`, `option::AsOption`, `result::ToResult`, `result::IntoResult`, `result::AsResult`, `either::ToEither`, and `either::IntoEither`, `either::AsEither`
* renamed `Option::chain*` and `Result::chain*` to `and_then` and `or_else` to avoid the eventual collision with `Iterator.chain`.
* Added a bunch of impls of `Default`
* Added a `#[deriving(Default)]` syntax extension
* Removed impls of `Zero` for `Option<T>` and vecs.
2013-09-14 00:01:04 -07:00
bors
4ac10f8f6e auto merge of #9185 : alexcrichton/rust/less-changing-directories, r=huonw
While usage of change_dir_locked is synchronized against itself, it's not
synchronized against other relative path usage, so I'm of the opinion that it
just really doesn't help in running tests. In order to prevent the problems that
have been cropping up, this completely removes the function.

All existing tests (except one) using it have been moved to run-pass tests where
they get their own process and don't need to be synchronized with anyone else.

There is one now-ignored rustpkg test because when I moved it to a run-pass test
apparently run-pass isn't set up to have 'extern mod rustc' (it ends up having
linkage failures).
2013-09-13 22:16:03 -07:00
Alex Crichton
0af2bd829e Remove all usage of change_dir_locked
While usage of change_dir_locked is synchronized against itself, it's not
synchronized against other relative path usage, so I'm of the opinion that it
just really doesn't help in running tests. In order to prevent the problems that
have been cropping up, this completely removes the function.

All existing tests (except one) using it have been moved to run-pass tests where
they get their own process and don't need to be synchronized with anyone else.

There is one now-ignored rustpkg test because when I moved it to a run-pass test
apparently run-pass isn't set up to have 'extern mod rustc' (it ends up having
linkage failures).
2013-09-13 21:58:00 -07:00
bors
52b9688f92 auto merge of #9176 : brson/rust/issue-9129, r=catamorphism
Servo is hitting this problem, so this is a workaround for lack of a real solution.

No tests because I couldn't actually reproduce the problem with either of the testcases in #9129
2013-09-13 21:06:02 -07:00
Alex Crichton
6c4c5f5631 Pass a more proper span to the syntax expanders
Closes #5794
2013-09-13 20:54:52 -07:00
Brendan Zabarauskas
ec8f88417c Add Orderable bound to num::Primitive 2013-09-14 13:31:31 +10:00
blake2-ppc
15c9dc7a86 extra::workcache: Remodel the (internal) struct Work
Using an enum with two cases for `Work` reveals simpler code than the
previous `Option<Either<X, Y>>` representation.
2013-09-14 04:07:51 +02:00
blake2-ppc
830ac37ca2 std::logging: Use a more specific enum than Either 2013-09-14 04:07:43 +02:00
blake2-ppc
b4eff79f38 extra::test: Use Result instead of Either.
OptRes was combining a successful value with an error message, which
fits the Result type perfectly.
2013-09-14 04:07:43 +02:00
blake2-ppc
92c4c077a0 syntax: Remove use of Either in parse.rs
The arg or capture type alias was actually never used for the capture
case, so the code is simplified with `Either<arg, ()>` replaced by `arg`
2013-09-14 04:07:43 +02:00
bors
a241deb979 auto merge of #9173 : thestinger/rust/offset, r=alexcrichton
This was intended to always use inbounds pointer arithmetic now.
2013-09-13 18:00:58 -07:00
Lindsey Kuper
ade7df43d6 Refactor libsyntax Visitor impls to use default methods. 2013-09-13 20:48:58 -04:00
Lindsey Kuper
462dcc8e7a Minor cleanup and formatting tweaks to the rust-mode README 2013-09-13 20:46:41 -04:00
Brian Anderson
c62919f607 Work around a compiler crash folding labeled break. #9129
Servo is hitting this problem, so this is a workaround for a lack of a real solution.
2013-09-13 16:00:18 -07:00
Daniel Micay
298f06f267 make ! support the equality/ordering operators
An expression such as `bottom == not_bottom` or `not_bottom == bottom`
already compiled, but this fixes the case where both sides are `bottom`.
2013-09-13 17:31:59 -04:00
Daniel Micay
2dec95e417 ptr: fix offset intrinsic
This was intended to always use inbounds pointer arithmetic now.
2013-09-13 17:14:24 -04:00
bors
150b4ffccc auto merge of #9158 : thestinger/rust/extern, r=alexcrichton
Since function pointers do not carry along the function attributes with
them in the type, this needs to be set on the call instruction itself.

Closes #9152
2013-09-13 14:10:52 -07:00
bors
b81743e69c auto merge of #9151 : catamorphism/rust/rustpkg-target-specific-subdirectory, r=brson
r? @brson As per rustpkg.md, rustpkg now builds in a target-specific
subdirectory of build/, and installs libraries into a target-specific
subdirectory of lib.

Closes #8672
2013-09-13 12:55:54 -07:00
bors
05bbb480a2 auto merge of #9170 : alexcrichton/rust/flaky-fileinput, r=erickt
The glob tests cannot change the current working directory because the other tests (namely the fileinput ones) depend on the current working directory not changing.
2013-09-13 11:45:56 -07:00
Alex Crichton
a7215dd284 Move glob tests to a run-pass test
The normal unit tests cannot change the current working directory because it
messes with the other tests which depend on a particular working directory.
2013-09-13 10:52:22 -07:00
Tim Chevalier
24fdb1d102 rustc/rustpkg: Use a target-specific subdirectory in build/ and lib/
As per rustpkg.md, rustpkg now builds in a target-specific
subdirectory of build/, and installs libraries into a target-specific
subdirectory of lib.

Closes #8672
2013-09-13 10:43:22 -07:00
Daniel Micay
1ac37d50c0 set sret attribute as needed on call instructions
Since function pointers do not carry along the function attributes with
them in the type, this needs to be set on the call instruction itself.

Closes #9152
2013-09-13 12:34:25 -04:00
Erick Tryzelaar
93683ae6da std: Fix another windows problem with the unwrap_or_default rename 2013-09-13 07:09:32 -07:00
Erick Tryzelaar
28eb49bfbf std: rename Option.chain to Option.and_then on windows 2013-09-13 06:58:46 -07:00
klutzy
3924cb031f std::rt::io: Fix file I/O on Win32
It was broken on win32 because of header inconsistency.
2013-09-13 19:23:57 +09:00
bors
7c8f503ac5 auto merge of #9141 : alexcrichton/rust/ignore-fileinput, r=catamorphism
These tests are being very flaky on the bots, and the reason is that files are
being created and then when attempted to get read they actually don't exist. I'm
not entirely sure why this is happening, but I also don't fully trust the
std::io implemention using @-boxes to close/flush/write files at the right time.

This moves the tests to using std::rt::io which is hopefully more robust and
something that we can actually reason about. Sadly, due to #8810, these tests
fail on windows, so they're all ignored on windows right now.
2013-09-13 02:25:49 -07:00
Alex Crichton
62ba835573 Translate nested items in default methods
Closes #9123
2013-09-13 01:42:44 -07:00
bors
fd39bd169c auto merge of #9148 : jakub-/rust/rustpkg-install-mkdir-p, r=catamorphism
Testing this is a little tricky as an intermediate temporary directory is only used for remote git repositories and therefore that path cannot be reliably exercised in the tests.
2013-09-13 01:00:50 -07:00
Alex Crichton
d0462f070c Improve the local_data docs slightly
Remove references to local_data::Key and only mention the macro for how to
construct new keys into local data.
2013-09-12 23:26:06 -07:00
bors
323e8f07ff auto merge of #9087 : fhahn/rust/rust_crate_map, r=brson
This patch converts the rust_crate_map.cpp to Rust as mentioned at the end of #8880.
2013-09-12 23:00:51 -07:00
Steven Fackler
ef964a162f Stop using newtypes in rt::io::buffered
This is a workaround for #9155. Currently, any uses of BufferedStream
outside of libstd ICE.
2013-09-12 21:48:47 -07:00