Commit graph

18837 commits

Author SHA1 Message Date
Niko Matsakis
df016dc4bf Update type visitor to use &Visitor and not @Visitor 2013-08-11 14:01:23 -04:00
Niko Matsakis
66b8ad5867 borrowck: Integrate AutoBorrowObj into borrowck / mem_categorization
Also cleanup the treatment of mutability in mem_categorization, which still
included the concept of interior mutability. At some point, we should
refactor the types to exclude the possibility of interior mutability rather
than just ignoring the mutability value in those cases.
2013-08-11 14:01:23 -04:00
Niko Matsakis
1bceb98084 typeck: Modify method resolution to use new object adjustments, and
to favor inherent methods over extension methods.

The reason to favor inherent methods is that otherwise an impl
like

    impl Foo for @Foo { fn method(&self) { self.method() } }

causes infinite recursion.  The current change to favor inherent methods is
rather hacky; the method resolution code is in need of a refactoring.
2013-08-11 14:01:23 -04:00
Niko Matsakis
006c6b6be4 trans: Rely on new AutoBorrowObj adjustment to match up object receivers
Note: some portions of this commit written by @Sodel-the-Vociferous
(Daniel Ralston)
2013-08-11 14:01:19 -04:00
Niko Matsakis
6f319812d6 ty: Add (but do not yet use) AutoBorrowObject option to adjustments
Note: some portions of this commit written by @Sodel-the-Vociferous
(Daniel Ralston)
2013-08-11 14:01:19 -04:00
Niko Matsakis
38357ebef4 typeck/check/method: Remove pub from most methods 2013-08-11 13:59:46 -04:00
Niko Matsakis
38b2e2980e Misc small cleanups 2013-08-11 13:59:46 -04:00
Niko Matsakis
6fe59bf877 Add a field borrow_offset to the type descriptor indicating
what amount a T* pointer must be adjusted to reach the contents
of the box. For `~T` types, this requires knowing the type `T`,
which is not known in the case of objects.
2013-08-11 13:59:45 -04:00
bors
63c62bea3a auto merge of #8420 : blake2-ppc/rust/shrink-token, r=cmr
`enum Token` was 192 bytes (64-bit), as pointed out by pnkfelix; the only
bloating variant being `INTERPOLATED(nonterminal)`.

Updating `enum nonterminal` to use ~ where variants included big types,
shrunk size_of(Token) to 32 bytes (64-bit).

I am unsure if the `nt_ident` variant should have an indirection, with
ast::ident being only 16 bytes (64-bit), but without this, enum Token
would be 40 bytes.

A dumb benchmark says that compilation time is unchanged, while peak
memory usage for compiling std.rs is down 3%

Before::

    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1 src/libstd/std.rs
    19.00user 0.39system 0:19.41elapsed 99%CPU (0avgtext+0avgdata 627820maxresident)k
    0inputs+28896outputs (0major+228665minor)pagefaults 0swaps
    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc -O --cfg stage1 src/libstd/std.rs
    31.64user 0.34system 0:32.02elapsed 99%CPU (0avgtext+0avgdata 629876maxresident)k
    0inputs+22432outputs (0major+229411minor)pagefaults 0swaps

After::

    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1 src/libstd/std.rs
    19.07user 0.45system 0:19.55elapsed 99%CPU (0avgtext+0avgdata 609384maxresident)k
    0inputs+28896outputs (0major+221997minor)pagefaults 0swaps

    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc -O --cfg stage1 src/libstd/std.rs
    31.90user 0.34system 0:32.28elapsed 99%CPU (0avgtext+0avgdata 612080maxresident)k
    0inputs+22432outputs (0major+223726minor)pagefaults 0swaps
2013-08-11 10:50:10 -07:00
Niko Matsakis
3aefb9649d librustc: Convert from @Object to @mut Object as needed 2013-08-11 13:26:59 -04:00
Niko Matsakis
96254b4090 libsyntax: Update from @Object to @mut Object as required 2013-08-11 13:23:40 -04:00
David Manescu
767688fc3d Fixed #8451 - extra::stats::write_boxplot() applied to negative or zero sample values 2013-08-12 01:32:05 +10:00
bors
f08851e31a auto merge of #8421 : alexcrichton/rust/unnamed-addr, r=thestinger
This can be applied to statics and it will indicate that LLVM will attempt to
merge the constant in .data with other statics.

I have preliminarily applied this to all of the statics generated by the new
`ifmt!` syntax extension. I compiled a file with 1000 calls to `ifmt!` and a
separate file with 1000 calls to `fmt!` to compare the sizes, and the results
were:

```
fmt           310k
ifmt (before) 529k
ifmt (after)  202k
```

This now means that ifmt! is both faster and smaller than fmt!, yay!
2013-08-11 07:29:07 -07:00
bors
45da2a5f48 auto merge of #8412 : thestinger/rust/vector-add, r=alexcrichton 2013-08-11 04:11:08 -07:00
Daniel Micay
83b3a0eaf1 fix unused imports 2013-08-11 03:17:01 -04:00
Daniel Micay
774c9aebb3 move strdup_uniq lang item to std::str 2013-08-11 03:14:35 -04:00
Daniel Micay
768c9a43ab str: optimize with_capacity
before:

test bench_with_capacity ... bench: 104 ns/iter (+/- 4)

after:

test bench_with_capacity ... bench: 56 ns/iter (+/- 1)
2013-08-11 03:14:35 -04:00
Daniel Micay
2afed31ecc vec: optimize the Add implementation
before:

test add ... bench: 164 ns/iter (+/- 1)

after:

test add ... bench: 113 ns/iter (+/- 2)
2013-08-11 03:14:35 -04:00
Daniel Micay
7db605cd15 disable 64-bit CheckedMul on 32-bit
code generation problem reported as issue #8449
2013-08-11 02:58:52 -04:00
Daniel Micay
076b91f8ad add intrinsics for checked overflow add/sub/mul 2013-08-11 02:51:20 -04:00
blake2-ppc
5cfad6fbae syntax: Shrink enum Token and enum nonterminal
`enum Token` was 192 bytes (64-bit), as pointed out by pnkfelix; the only
bloating variant being `INTERPOLATED(nonterminal)`.

Updating `enum nonterminal` to use ~ where variants included big types,
shrunk size_of(Token) to 32 bytes (64-bit).

I am unsure if the `nt_ident` variant should have an indirection, with
ast::ident being only 16 bytes (64-bit), but without this, enum Token
would be 40 bytes.

A dumb benchmark says that compilation time is unchanged, while peak
memory usage for compiling std.rs is down 3%

Before::

    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1 src/libstd/std.rs
    19.00user 0.39system 0:19.41elapsed 99%CPU (0avgtext+0avgdata 627820maxresident)k
    0inputs+28896outputs (0major+228665minor)pagefaults 0swaps
    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc -O --cfg stage1 src/libstd/std.rs
    31.64user 0.34system 0:32.02elapsed 99%CPU (0avgtext+0avgdata 629876maxresident)k
    0inputs+22432outputs (0major+229411minor)pagefaults 0swaps

After::

    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1 src/libstd/std.rs
    19.07user 0.45system 0:19.55elapsed 99%CPU (0avgtext+0avgdata 609384maxresident)k
    0inputs+28896outputs (0major+221997minor)pagefaults 0swaps

    $ time ./x86_64-unknown-linux-gnu/stage1/bin/rustc -O --cfg stage1 src/libstd/std.rs
    31.90user 0.34system 0:32.28elapsed 99%CPU (0avgtext+0avgdata 612080maxresident)k
    0inputs+22432outputs (0major+223726minor)pagefaults 0swaps
2013-08-11 06:56:07 +02:00
bors
eebcff1493 auto merge of #8404 : stepancheg/rust/zero-unit-inline, r=alexcrichton
Follow-up to #8155
2013-08-10 19:53:06 -07:00
blake2-ppc
0b35e3b5a3 extra::treemap: Use IteratorUtil::peekable
Replace the previous equivalent iterator adaptor with .peekable().
Refactor the set operation iterators so that they are easier to read.
2013-08-11 02:18:21 +02:00
Simon Sapin
deb7b67aa1 Add a "peekable" iterator adaptor, with a peek() method that returns the next element. 2013-08-11 02:18:21 +02:00
blake2-ppc
b44f423dd4 std::iterator: Rename .peek() to .inspect() 2013-08-11 01:57:20 +02:00
Luqman Aden
fcfd6e7c79 rustc: Add --target-cpu flag to select a more specific processor instead of the default, 'generic'. 2013-08-10 17:03:43 -04:00
Erick Tryzelaar
20953bb1fb Merge branch 'match' of https://github.com/msullivan/rust into rollup 2013-08-10 13:04:16 -07:00
Erick Tryzelaar
fb00463feb Merge branch 'issue-8393-attributes-in-macros' of https://github.com/nikomatsakis/rust into rollup 2013-08-10 13:03:19 -07:00
Erick Tryzelaar
b19c2ed8f3 Merge branch 'master' of https://github.com/p2j4d2c/rust into rollup 2013-08-10 13:02:44 -07:00
Erick Tryzelaar
4e92faad13 Merge branch 'trie-bound-iters' of https://github.com/dim-an/rust into rollup 2013-08-10 13:01:20 -07:00
Erick Tryzelaar
5e1ca23a65 Merge branch 'vec-exh' of https://github.com/stepancheg/rust into rollup 2013-08-10 13:00:20 -07:00
Erick Tryzelaar
09f4c9af13 Merge branch 'enum-method-privacy' of https://github.com/michaelwoerister/rust into rollup
Conflicts:
	src/libsyntax/opt_vec.rs
2013-08-10 12:59:52 -07:00
Erick Tryzelaar
c8a93efdae Merge remote-tracking branch 'remotes/origin/master' into cleanup-iterators 2013-08-10 12:04:40 -07:00
bors
2ba36ec629 auto merge of #8327 : sstewartgallus/rust/factor_out_waitqueue, r=bblum
I'm a bit disappointed that I couldn't figure out how to factor out more of the code implementing `extra::sync` but I feel this is an okay start. Also I added some documentation explaining that `WaitQueue` isn't thread safe, and needs an exclusive lock.
 
@bblum
2013-08-10 07:47:14 -07:00
Erick Tryzelaar
5b2c1c543f syntax and rustc: fix some warnings 2013-08-10 07:33:22 -07:00
Erick Tryzelaar
e48ca19bc5 std: fix the non-stage0 str::raw::slice_bytes which broke in a merge 2013-08-10 07:33:22 -07:00
Erick Tryzelaar
6fcf2ee8e3 std: Transform.find_ -> .find 2013-08-10 07:33:22 -07:00
Erick Tryzelaar
f9dee04aaa std: Iterator.len_ -> .len 2013-08-10 07:33:22 -07:00
Erick Tryzelaar
74d2552b0a std: Iterator.last_ -> .last 2013-08-10 07:33:21 -07:00
Erick Tryzelaar
1db62d8311 std: Iterator.chain_ -> .chain 2013-08-10 07:33:21 -07:00
Erick Tryzelaar
60c2661684 std: Iterator.flat_map_ -> .flat_map 2013-08-10 07:33:21 -07:00
Erick Tryzelaar
24d2cd0ef4 std: Iterator.take_ -> .take 2013-08-10 07:33:21 -07:00
Erick Tryzelaar
68f40d215e std: Rename Iterator.transform -> .map
cc #5898
2013-08-10 07:33:21 -07:00
Erick Tryzelaar
4062b84f4a std: merge Iterator and IteratorUtil 2013-08-10 07:02:17 -07:00
Erick Tryzelaar
a6614621af std: merge iterator::DoubleEndedIterator and DoubleEndedIteratorUtil 2013-08-10 07:01:08 -07:00
Erick Tryzelaar
229eeda4cd Clean up some unused imports in tests 2013-08-10 07:01:07 -07:00
Erick Tryzelaar
fad7857c7b Mass rename of .consume{,_iter}() to .move_iter()
cc #7887
2013-08-10 07:01:07 -07:00
bors
e70aac572a auto merge of #8270 : dotdash/rust/ret_alloca_elim, r=pcwalton
When there is only a single store to the ret slot that dominates the
load that gets the value for the "ret" instruction, we can elide the
ret slot and directly return the operand of the dominating store
instruction. This is the same thing that clang does, except for a
special case that doesn't seem to affect us.

Fixes #8238
2013-08-10 04:44:13 -07:00
Björn Steinbrink
4b74b8dca4 Elide unnecessary ret slot allocas
When there is only a single store to the ret slot that dominates the
load that gets the value for the "ret" instruction, we can elide the
ret slot and directly return the operand of the dominating store
instruction. This is the same thing that clang does, except for a
special case that doesn't seem to affect us.

Fixes #8238
2013-08-10 11:04:50 +02:00
bors
f0fc9c92ff auto merge of #8425 : dim-an/rust/increase-stack-size, r=brson 2013-08-10 01:20:14 -07:00
Chris Morgan
1ceee6a843 Remove in-tree test binary.
I presume this was accidentally committed.
2013-08-10 16:14:39 +10:00
bors
60f5011005 auto merge of #8296 : erickt/rust/remove-str-trailing-nulls, r=erickt
This PR fixes #7235 and #3371, which removes trailing nulls from `str` types. Instead, it replaces the creation of c strings with a new type, `std::c_str::CString`, which wraps a malloced byte array, and respects:

*  No interior nulls
* Ends with a trailing null
2013-08-09 21:56:17 -07:00
Erick Tryzelaar
ee59aacac4 Merge remote-tracking branch 'remotes/origin/master' into remove-str-trailing-nulls 2013-08-09 18:48:01 -07:00
bors
e81e81f234 auto merge of #8387 : brson/rust/nooldrt, r=brson 2013-08-09 18:41:13 -07:00
Michael Sullivan
437a4c28a3 Fix interaction between default matches and guards. Closes #3121. 2013-08-09 17:39:21 -07:00
Brian Anderson
b473ce304f rustc: Obey RUST_MIN_STACK env var
A lot of people are hitting stack overflows in rustc. This will make it
easier to experiment with stack size.
2013-08-09 17:28:27 -07:00
Brian Anderson
b75915d0ca Remove the C++ runtime. Sayonara 2013-08-09 16:45:50 -07:00
Dmitry Ermolov
980bcdd381 Increase system stack size. 2013-08-10 03:37:39 +04:00
bors
6f6dce7bbc auto merge of #8176 : catamorphism/rust/rustpkg-extern-mod, r=catamorphism
r? @graydon Also, notably, make rustpkgtest depend on the rustpkg executable (otherwise, tests that shell out to rustpgk might run when rustpkg doesn't exist).
2013-08-09 16:17:10 -07:00
Michael Sullivan
8cefcc0ac5 Fix some warnings. 2013-08-09 16:07:26 -07:00
Tim Chevalier
37fd8f03fd rustpkg: Simplify the PkgId struct
Get rid of special cases for names beginning with "rust-" or
containing hyphens, and just store a Path in a package ID. The Rust-identifier
for the crate is none of rustpkg's business.
2013-08-09 14:11:55 -07:00
Tim Chevalier
96fd606ddd std/rustc/rustpkg/syntax: Support the extern mod = ... form
This commit allows you to write:

 extern mod x = "a/b/c";

which means rustc will search in the RUST_PATH for a package with
ID a/b/c, and bind it to the name `x` if it's found.

Incidentally, move get_relative_to from back::rpath into std::path
2013-08-09 14:11:50 -07:00
Erick Tryzelaar
cab6d46e58 rustpkg: another fix for windows 2013-08-09 14:06:03 -07:00
bors
1de201c3c6 auto merge of #8415 : brson/rust/newrt-local-heap-perf, r=pcwalton,brson
Mostly optimizing TLS accesses to bring local heap allocation performance
closer to that of oldsched. It's not completely at parity but removing the
branches involved in supporting oldsched and optimizing pthread_get/setspecific
to instead use our dedicated TCB slot will probably make up for it.
2013-08-09 13:53:08 -07:00
Alex Crichton
2f3fde60c3 Implement an address_insignificant attribute
This can be applied to statics and it will indicate that LLVM will attempt to
merge the constant in .data with other statics.

I have preliminarily applied this to all of the statics generated by the new
`ifmt!` syntax extension. I compiled a file with 1000 calls to `ifmt!` and a
separate file with 1000 calls to `fmt!` to compare the sizes, and the results
were:

fmt           310k
ifmt (before) 529k
ifmt (after)  202k

This now means that ifmt! is both faster and smaller than fmt!, yay!
2013-08-09 13:49:41 -07:00
Corey Richardson
4be086b7f6 Remove rtdebug_! and make rtdebug! work properly.
It now actually does logging, and is compiled out when `--cfg rtdebug` is not
given to the libstd build, which it isn't by default. This makes the rt
benchmarks 18-50% faster.
2013-08-09 14:48:10 -04:00
Michael Sullivan
fb32ddf1a2 Fix vector pattern matching. Closes #6909. 2013-08-09 11:29:41 -07:00
Michael Sullivan
6362c3ad6b Switch to using .enumerate() some places in _match. 2013-08-09 11:29:41 -07:00
Erick Tryzelaar
c14e14e63a std: more windows fixes to os.rs and run.rs 2013-08-09 11:13:26 -07:00
bors
c20b90647e auto merge of #8369 : yichoi/rust/arm-test, r=sanxiyn
fix some part of test code to pass make check on ARM Android
2013-08-09 10:59:08 -07:00
Felix S. Klock II
eee044734c Add parse-error recovery for erroneous struct_id { } form.
There are 4 different new tests, to check some different scenarios for
what the parse context is at the time of recovery, becasue our
compile-fail infrastructure does not appear to handle verifying
error-recovery situations.

Differentiate between unit-like struct definition item and unit-like
struct construction in the error message.

----

More generally, outlines a more generic strategy for parse error
recovery: By committing to an expression/statement at set points in
the parser, we can then do some look-ahead to catch common mistakes
and skip over them.

One detail about this strategy is that you want to avoid emitting the
"helpful" message unless the input is reasonably close to the case of
interest.  (E.g. do not warn about a potential unit struct for an
input of the form `let hmm = do foo { } { };`)

To accomplish this, I added (partial) last_token tracking; used for
`commit_stmt` support.

The check_for_erroneous_unit_struct_expecting fn returns bool to
signal whether it "made progress"; currently unused; this is meant for
use to compose several such recovery checks together in a loop.
2013-08-09 18:32:46 +02:00
bors
74efdf6197 auto merge of #8352 : stepancheg/rust/ipv6-to-str, r=luqmana
Reported by @luqmana
2013-08-09 08:17:04 -07:00
Huon Wilson
c8ca989c07 std: add a Clone impl for HashSet. 2013-08-10 00:44:35 +10:00
bors
6928a10e3f auto merge of #8362 : sfackler/rust/env, r=alexcrichton
env! aborts compilation of the specified environment variable is not
defined and takes an optional second argument containing a custom
error message. option_env! creates an Option<&'static str> containing
the value of the environment variable.

There are no run-pass tests that check the behavior when the environment
variable is defined since the test framework doesn't support setting
environment variables at compile time as opposed to runtime. However,
both env! and option_env! are used inside of rustc itself, which should
act as a sufficient test.

Fixes #2248.
2013-08-09 05:35:06 -07:00
Dmitry Ermolov
2a2ea5e276 Implement lower_bound_iter/upper_bound_iter for TrieMap/TrieSet 2013-08-09 15:51:49 +04:00
Stepan Koltsov
ae81151ad6 Fix Ipv6Addr to_str for ::1:x.x.x.x addresses
Reported by luqmana@
2013-08-09 13:53:28 +04:00
bors
2fe2e59c67 auto merge of #8361 : alexcrichton/rust/fix-node-hashes-in-crates, r=thestinger
When running rusti 32-bit tests from a 64-bit host, these errors came up frequently. My best idea as to what was happening is:

1. First, if you hash the same `int` value on 32-bit and 64-bit, you will get two different hashes.
2. In a cross-compile situation, let's say x86_64 is building an i686 library, all of the hashes will be 64-bit hashes.
3. Then let's say you use the i686 libraries and then attempt to link against the same i686 libraries, because you're calculating hashes with a 32-bit int instead of a 64-bit one, you'll have different hashes and you won't be able to find items in the metadata (the items were generated with a 64-bit int).

This patch changes the items to always be hashed as an `i64` to preserve the hash value across architectures. Here's a nice before/after for this patch of the state of rusti tests

```
host   target  before  after
64     64      yes     yes
64     32      no      no (llvm assertion)
32     64      no      yes
32     32      no      no (llvm assertion)
```

Basically one case started working, but currently when the target is 32-bit LLVM is having a lot of problems generating code. That's another separate issue though.
2013-08-09 02:53:08 -07:00
Brian Anderson
d392556160 std: Fix perf of local allocations in newsched
Mostly optimizing TLS accesses to bring local heap allocation performance
closer to that of oldsched. It's not completely at parity but removing the
branches involved in supporting oldsched and optimizing pthread_get/setspecific
to instead use our dedicated TCB slot will probably make up for it.
2013-08-09 01:15:31 -07:00
bors
094e4260f8 auto merge of #8357 : omasanori/rust/cleanup, r=alexcrichton
I feel it's time to eliminate them (and add some testcases.)
2013-08-09 00:17:06 -07:00
OGINO Masanori
b4d6ae5bb8 Remove redundant Ord method impls.
Basically, generic containers should not use the default methods since a
type of elements may not guarantees total order. str could use them
since u8's Ord guarantees total order. Floating point numbers are also
broken with the default methods because of NaN. Thanks for @thestinger.

Timespec also guarantees total order AIUI. I'm unsure whether
extra::semver::Identifier does so I left it alone. Proof needed.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-08-09 14:28:14 +09:00
bors
a931e04b75 auto merge of #8350 : dim-an/rust/fix-struct-match, r=pcwalton
Code that collects fields in struct-like patterns used to ignore
wildcard patterns like `Foo{_}`. But `enter_defaults` considered
struct-like patterns as default in order to overcome this
(accoring to my understanding of situation).

However such behaviour caused code like this:
```
enum E {
    Foo{f: int},
    Bar
}
let e = Bar;
match e {
    Foo{f: _f} => { /* do something (1) */ }
    _ => { /* do something (2) */ }
}
```
consider pattern `Foo{f: _f}` as default. That caused inproper behaviour
and even segfaults while trying to destruct `Bar` as `Foo{f: _f}`.
Issues: #5625 , #5530.

This patch fixes `collect_record_or_struct_fields` to split cases of
single wildcard struct-like pattern and no struct-like pattern at all.
Former case resolved with `enter_rec_or_struct` (and not with
`enter_defaults`).

Closes #5625.
Closes #5530.
2013-08-08 21:41:05 -07:00
blake2-ppc
854e219d0a std::tuple: Use != properly in Eq::ne for tuples
Just like the Ord methods, Eq::ne needs to be implemented in terms of
the same operation on the elements.
2013-08-09 05:54:49 +02:00
Steven Stewart-Gallus
1e576a35eb Isolate common wait_end logic 2013-08-08 19:34:01 -07:00
Erick Tryzelaar
56730c094c Merge remote-tracking branch 'remotes/origin/master' into remove-str-trailing-nulls 2013-08-08 19:27:03 -07:00
bors
7a1b61d631 auto merge of #8336 : stepancheg/rust/socket-addr-from-str, r=brson
FromStr implemented from scratch.

It is overengineered a bit, however.

Old implementation handles errors by fail!()-ing. And it has bugs, like it accepts `127.0.0.1::127.0.0.1` as IPv6 address, and does not handle all ipv4-in-ipv6 schemes. So I decided to implement parser from scratch.
2013-08-08 19:08:02 -07:00
Niko Matsakis
33c6d3fd78 Allow attributes to appear as macro arguments
Fixes #8393
2013-08-08 19:41:02 -04:00
bors
936f70bd87 auto merge of #8356 : toddaaro/rust/ws, r=brson
This pull request converts the scheduler from a naive shared queue scheduler to a naive workstealing scheduler. The deque is still a queue inside a lock, but there is still a substantial performance gain. Fiddling with the messaging benchmark I got a ~10x speedup and observed massively reduced memory usage.

There are still *many* locations for optimization, but based on my experience so far it is a clear performance win as it is now.
2013-08-08 16:32:02 -07:00
Stepan Koltsov
b9945f83c9 Add #[inline] to impl Zero for ()
Follow-up to #8155
2013-08-09 02:19:50 +04:00
Tim Chevalier
7c1eb83052 rustpkg: Eliminate a copy 2013-08-08 15:17:28 -07:00
bors
8f65dbfcfa auto merge of #8385 : cmr/rust/big-rollup, r=alexcrichton
This is a fairly large rollup, but I've tested everything locally, and none of
it should be platform-specific.

r=alexcrichton (bdfdbdd)
r=brson (d803c18)
r=alexcrichton (a5041d0)
r=bstrie (317412a)
r=alexcrichton (135c85e)
r=thestinger (8805baa)
r=pcwalton (0661178)
r=cmr (9397fe0)
r=cmr (caa4135)
r=cmr (6a21d93)
r=cmr (4dc3379)
r=cmr (0aa5154)
r=cmr (18be261)
r=thestinger (f10be03)
2013-08-08 14:32:02 -07:00
toddaaro
af2e03998d Enabled workstealing in the scheduler. Previously we had one global work queue shared by each scheduler. Now there is a separate work queue for each scheduler, and work is "stolen" from other queues when it is exhausted locally. 2013-08-08 14:13:41 -07:00
blake2-ppc
06783ce831 std::vec: Fix typo in fn ne 2013-08-08 23:07:24 +02:00
Corey Richardson
878e74e1ce Fix more priv fallout 2013-08-08 17:02:03 -04:00
blake2-ppc
8ed8a41c62 std::iterator::order test cases 2013-08-08 22:07:22 +02:00
blake2-ppc
5dde29c947 std: Fix tuple lexicographical order
Use the definition, where R is <, <=, >=, or >

    [x, ..xs] R [y, ..ys]  =  if x != y { x R y } else { xs R ys }

Previously, tuples would only implement < and derive the other
comparisons from it; this is incorrect. Included are several testcases
involving NaN comparisons that are now correct.

Previously, tuples would consider an element equal if both a < b and
b < a were false, this was also incorrect.
2013-08-08 22:07:22 +02:00
blake2-ppc
86da55e85b std: Fix Ord for Option, using iterator::order 2013-08-08 22:07:22 +02:00
blake2-ppc
9cac4ccc90 std::vec: Use iterator::order functions for Eq, Ord, TotalOrd, TotalEq 2013-08-08 22:07:21 +02:00
blake2-ppc
e0b08533b4 std: Implement traits for the one-tuple
(A,) did not have the trait implementations of 2- to 12- tuples.
2013-08-08 22:07:21 +02:00
blake2-ppc
a2e3cdfc36 extra::dlist: Use iterator::order for sequence ordering 2013-08-08 22:07:21 +02:00
blake2-ppc
5d9fd882b7 Add std::iterator::order with lexical ordering functions for sequences
Use Eq + Ord for lexicographical ordering of sequences.

For each of <, <=, >= or > as R, use::

    [x, ..xs] R [y, ..ys]  =  if x != y { x R y } else { xs R ys }

Previous code using `a < b` and then `!(b < a)` for short-circuiting
fails on cases such as  [1.0, 2.0] < [0.0/0.0, 3.0], where the first
element was effectively considered equal.
2013-08-08 22:07:21 +02:00