bors [Thu, 9 Jan 2014 17:31:36 +0000 (09:31 -0800)]
auto merge of #11376 : alexcrichton/rust/remove-eof, r=pcwalton
This is something I have been meaning to do for awhile, but upon inspection of the `eof` method on all of the `Reader` impls you may find some interesting surprises. The method returns a good answer for almost all wrapped I/O objects (buffered readers, mem readers, util readers, etc), but the actual return value on all I/O objects themselves is almost always useless.
Almost no I/O object other than a file actually knows when it's hit EOF or not. I think that pretending that all objects know when they've hit the end when almost none do is probably a bad idea. I can't really come up with a good answer to "is this file descriptor at eof" or "is this tcp stream at eof" much less "is this udp socket at eof". Due to being unable to answer these questions for *all* readers, I believe that it shouldn't be a part of the core `Reader` trait.
bors [Thu, 9 Jan 2014 14:26:27 +0000 (06:26 -0800)]
auto merge of #11412 : bjz/rust/num-cleanups, r=alexcrichton
The methods contained in `std::num::{Algebraic, Trigonometric, Exponential, Hyperbolic}` have now been moved into `std::num::Real`. This is part of an ongoing effort to simplify `std::num` (see issue #10387).
`std::num::RealExt` has also been removed from the prelude because it is not a commonly used trait.
bors [Thu, 9 Jan 2014 13:06:33 +0000 (05:06 -0800)]
auto merge of #11402 : bjz/rust/remove-approx, r=alexcrichton
This trait seems to stray too far from the mandate of a standard library as implementations may vary between use cases. Third party libraries should implement their own if they need something like it.
bors [Thu, 9 Jan 2014 11:51:27 +0000 (03:51 -0800)]
auto merge of #11394 : alexcrichton/rust/no-decorator, r=cmr
This is just an unnecessary trait that no one's ever going to parameterize over
and it's more useful to just define the methods directly on the types
themselves. The implementors of this type almost always don't want
inner_mut_ref() but they're forced to define it as well.
bors [Thu, 9 Jan 2014 08:16:30 +0000 (00:16 -0800)]
auto merge of #11386 : rcatolino/rust/ice-10955, r=pcwalton
So, like I mentioned in issue #10955 it doesn't seem like we need to call ```ty::subst_tps``` when the method is generic. But then I realized that this function doesn't mutate any of its input, and the return value is unused. Plus the type param substitution seems to be taken care of in ```trans_fn_ref_with_vtables```, so I thought I'd just try to remove it. As far as I can tell everything works.
Alex Crichton [Wed, 8 Jan 2014 04:05:33 +0000 (20:05 -0800)]
Remove the io::Decorator trait
This is just an unnecessary trait that no one's ever going to parameterize over
and it's more useful to just define the methods directly on the types
themselves. The implementors of this type almost always don't want
inner_mut_ref() but they're forced to define it as well.
Merge some numeric traits with Real and don't re-export RealExt
The methods contained in `std::num::{Algebraic, Trigonometric, Exponential, Hyperbolic}` have now been moved into `std::num::Real`. This is part of an ongoing effort to simplify `std::num` (see issue #10387).
`std::num::RealExt` has also been removed from the prelude because it is not a commonly used trait.
bors [Wed, 8 Jan 2014 19:26:30 +0000 (11:26 -0800)]
auto merge of #11401 : michaelwoerister/rust/issue11322, r=alexcrichton
`expand_include_str()` in libsyntax seems to have corrupted the CodeMap by always setting the BytePos of any included files to zero. It now uses `CodeMap::new_filemap()` which should set everything properly. This should fix issue #11322 but I don't want to close it before I have confirmation from the reporters that the problem is indeed fixed.
bors [Wed, 8 Jan 2014 16:46:33 +0000 (08:46 -0800)]
auto merge of #11407 : alexcrichton/rust/fix-snap, r=brson
If we bootstrap a cross compile from a stage1 compiler, then the stage1 compiler
already knows about the rustc => rustlib change, so we need to not add the extra
flag if it's a stage0 version of a target from a stage1 of another target.
Alex Crichton [Wed, 8 Jan 2014 16:16:48 +0000 (08:16 -0800)]
Fix the snapshot and cross compilation
If we bootstrap a cross compile from a stage1 compiler, then the stage1 compiler
already knows about the rustc => rustlib change, so we need to not add the extra
flag if it's a stage0 version of a target from a stage1 of another target.
bors [Wed, 8 Jan 2014 12:26:36 +0000 (04:26 -0800)]
auto merge of #11358 : pcwalton/rust/typed-arenas, r=alexcrichton
A typed arena is a type of arena that can only allocate objects of one
type. It is 3x faster than the existing arena and 13x faster than malloc
on Mac.
bors [Wed, 8 Jan 2014 08:56:35 +0000 (00:56 -0800)]
auto merge of #11391 : alexcrichton/rust/rustdoc-inline, r=brson
If a reexport comes from a non-public module, then the documentation for the
reexport will be inlined into the module that exports it, but if the reexport is
targeted at a public type (like the prelude), then it is not inlined but rather
hyperlinked.
Alex Crichton [Wed, 8 Jan 2014 02:46:16 +0000 (18:46 -0800)]
Inline reexports in rustdoc
If a reexport comes from a non-public module, then the documentation for the
reexport will be inlined into the module that exports it, but if the reexport is
targeted at a public type (like the prelude), then it is not inlined but rather
hyperlinked.
bors [Wed, 8 Jan 2014 01:56:32 +0000 (17:56 -0800)]
auto merge of #10854 : Kimundi/rust/result_compose_map_mutate_or, r=alexcrichton
This implements parts of the changes to `Option` I proposed and discussed in this thread: https://mail.mozilla.org/pipermail/rust-dev/2013-November/006254.html, and on IRC.
In short, the string "default" should not be used in any context that has nothing to do with the `std::default::Default` trait.
This PR consists of this change:
- Renamed `map_default -> map_or` and `mutate_default -> mutate_or_set`.
Patrick Walton [Tue, 7 Jan 2014 01:03:30 +0000 (17:03 -0800)]
libextra: Introduce typed arenas.
A typed arena is a type of arena that can only allocate objects of one
type. It is 3x faster than the existing arena and 13x faster than malloc
on Mac.
bors [Tue, 7 Jan 2014 23:46:38 +0000 (15:46 -0800)]
auto merge of #11364 : brson/rust/docs, r=alexcrichton
This reorganizes the documentation index to be more focused on the in-tree docs, and to clean up the style, and it also adds @steveklabnik's pointer guide.
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.