bors [Tue, 7 Jan 2014 19:01:41 +0000 (11:01 -0800)]
auto merge of #11263 : niftynif/rust/btree, r=catamorphism
Apologies for junking up the feed with all of these separate pull requests. I'm still getting the hang of git and will hopefully be doing less of this nonsense soon. I opened up another PR and closed the one from earlier today because the first PR was coming from the wrong branch of my repo.
Anyway, this contains a fleshed-out implementation of TotalEq/TotalOrd/Clone/ToStr for the whole B-tree structure and relevant tests, integrating suggestions and comments from several community members.
r? @catamorphism
bors [Tue, 7 Jan 2014 17:41:35 +0000 (09:41 -0800)]
auto merge of #11353 : alexcrichton/rust/improve-logging, r=brson
This will allow capturing of common things like logging messages, stdout prints
(using stdio println), and failure messages (printed to stderr). Any new prints
added to libstd should be funneled through these task handles to allow capture
as well.
Additionally, this commit redirects logging back through a `Logger` trait so the
log level can be usefully consumed by an arbitrary logger.
This commit also introduces methods to set the task-local stdout handles:
These methods all return the previous logger just in case it needs to be used
for inspection.
I plan on using this infrastructure for extra::test soon, but we don't quite
have the primitives that I'd like to use for it, so it doesn't migrate
extra::test at this time.
bors [Tue, 7 Jan 2014 13:56:36 +0000 (05:56 -0800)]
auto merge of #11342 : huonw/rust/trie-mut, r=alexcrichton
- Add `mut_iter`, `mut_lower_bound`, `mut_upper_bound`
- Remove some internal iterators
- Add benchmarks
- Improve performance of `{mut_,}{lower,upper}_bound`
- Minor clean-up of `extra::treemap` after I realised I wasn't exploiting macros to their full DRY potential.
Alex Crichton [Mon, 6 Jan 2014 22:14:17 +0000 (14:14 -0800)]
Fix parallel makefile builds
All the copying of files amongst one another was apparently causing something to
get corrupted. Instead of having files fly around, just update the directories
to link to.
Nif Ward [Tue, 7 Jan 2014 02:19:36 +0000 (21:19 -0500)]
Added in Clone/TotalEq/TotalOrd/ToStr traits to all parts of btree.
Equals is now compact and uses vec's equals method. Cmp compares
all elements on branches and leaves (Nodes).
Alex Crichton [Mon, 6 Jan 2014 22:17:23 +0000 (14:17 -0800)]
Don't read forever on a file descriptor
Similarly to the recent commit to do this for networking, there's no reason that
a read on a file descriptor should continue reading until the entire buffer is
full. This makes sense when dealing with literal files, but when dealing with
things like stdin this doesn't make sense.
bors [Tue, 7 Jan 2014 00:31:52 +0000 (16:31 -0800)]
auto merge of #11354 : brson/rust/versionwin, r=alexcrichton
The makefiles and the windows installer disagree on the name of this file. In practical terms this change only means that the '-pre' installers will be named 'rust-0.9-pre-install.exe' instead 'rust-0.9-install.exe'.
Alex Crichton [Mon, 6 Jan 2014 18:26:11 +0000 (10:26 -0800)]
Support arbitrary stdout/stderr/logger handles
This will allow capturing of common things like logging messages, stdout prints
(using stdio println), and failure messages (printed to stderr). Any new prints
added to libstd should be funneled through these task handles to allow capture
as well.
Additionally, this commit redirects logging back through a `Logger` trait so the
log level can be usefully consumed by an arbitrary logger.
This commit also introduces methods to set the task-local stdout handles:
These methods all return the previous logger just in case it needs to be used
for inspection.
I plan on using this infrastructure for extra::test soon, but we don't quite
have the primitives that I'd like to use for it, so it doesn't migrate
extra::test at this time.
bors [Mon, 6 Jan 2014 18:31:46 +0000 (10:31 -0800)]
auto merge of #11334 : alexcrichton/rust/fix-native-tcp, r=pcwalton
libnative erroneously would attempt to fill the entire buffer in a call to
`read` before returning, when rather it should return immediately because
there's not guaranteed to be any data that will ever be received again.
bors [Mon, 6 Jan 2014 13:56:52 +0000 (05:56 -0800)]
auto merge of #11327 : nielsle/rust/rustpkg_argparse, r=alexcrichton
Rearrange some code in rustpkg:
* Move command line argument parsing to parse_args.rs
* Introduce an enum to descibe commands such as Build, Install, and Clean.
* Move sysroot from Context to BuildContext, to make parse_args more modular.
This is my first pull request, so please tell me if there is anything I need to do.
bors [Mon, 6 Jan 2014 12:41:38 +0000 (04:41 -0800)]
auto merge of #11161 : eddyb/rust/de-at-visitor, r=huonw
The primary user of `@T`/`P<T>` references from `Visitor` was `ast_map`, which in turn had two users (phase 3 in rustc and a step in loading items from metadata).
Both of them have been rewritten to use `ast_map` as a folder (this might speed up the compilation time of stage2 rustc by 100-200ms just because a fold + a visit are merged together).
bors [Mon, 6 Jan 2014 08:31:57 +0000 (00:31 -0800)]
auto merge of #11315 : alexcrichton/rust/issue-11309, r=huonw
There was a scheduling race where a child may not increment the global task
count before the parent exits, and the parent would then think that there are no
more tasks left.
Alex Crichton [Mon, 6 Jan 2014 06:16:16 +0000 (22:16 -0800)]
Don't wait for a full buffer when reading TCP
libnative erroneously would attempt to fill the entire buffer in a call to
`read` before returning, when rather it should return immediately because
there's not guaranteed to be any data that will ever be received again.
Alex Crichton [Sat, 4 Jan 2014 20:02:02 +0000 (12:02 -0800)]
Guarantee that native tasks wait for children
There was a scheduling race where a child may not increment the global task
count before the parent exits, and the parent would then think that there are no
more tasks left.
bors [Mon, 6 Jan 2014 03:31:53 +0000 (19:31 -0800)]
auto merge of #11270 : lkuper/rust/trait-docs, r=cmr
I've been wanting to explain default methods in the tutorial for ages. While I was at it I tried to clarify some other parts of the traits section. I'm sure this could be improved further; suggestions welcome.
Using a private function of a library is a bad idea: several people (on
Linux) were meeting with linking errors because of it (different/older
versions of glibc).
Using a private function of a library is a bad idea: several people (on
Linux) were meeting with linking errors because of it (different/older
versions of glibc).
Alex Crichton [Sat, 4 Jan 2014 20:21:46 +0000 (12:21 -0800)]
Don't abort the process in native::start
If the main closure failed, then the `exit_code` variable would still be `None`,
and the `unwrap()` was failing (triggering a process abort). This changes the
`unwrap()` to an `unwrap_or()` in order to prevent process abort and detect when
the native task failed.
bors [Sun, 5 Jan 2014 05:31:51 +0000 (21:31 -0800)]
auto merge of #11314 : adridu59/rust/patch-license, r=brson
- don't check for an hardcoded copyright claim year, check the 2 surrounding strings instead
- logic: if either the `//` or `#`-style copyright patterns are found, don't invalidate
- cleanup hardcoded content and streamline the few files with different line breaks
bors [Sat, 4 Jan 2014 23:21:46 +0000 (15:21 -0800)]
auto merge of #11188 : brson/rust/noderef, r=brson
This removes the feature where newtype structs can be dereferenced like pointers, and likewise where certain enums can be dereferenced (which I imagine nobody realized still existed). This ad-hoc behavior is to be replaced by a more general overloadable dereference trait in the future.
I've been nursing this patch for two months and think it's about rebased up to master.
@nikomatsakis this makes a bunch of your type checking code noticeably uglier.
bors [Sat, 4 Jan 2014 21:56:48 +0000 (13:56 -0800)]
auto merge of #11284 : huonw/rust/issue-6233, r=alexcrichton
If there is a lot of data in thread-local storage some implementations
of pthreads (e.g. glibc) fail if you don't request a stack large enough
-- by adjusting for the minimum size we guarantee that our stacks are
always large enough. Issue #6233.