Commit graph

19002 commits

Author SHA1 Message Date
gareth
d22f417c74 Add IterBytes impls for float/f32/f64. This allows creating
HashMaps with floats as keys.
2013-06-15 17:58:38 +01:00
bors
eac0200f18 auto merge of #7148 : catamorphism/rust/rustpkg_tests, r=graydon
r? @graydon Automate more tests described in the commands.txt file,
and add infrastructure for running them. Right now, tests shell
out to call rustpkg. This is not ideal.

Goes part of the way towards addressing #5683
2013-06-15 08:12:57 -07:00
bors
82f2e4dc9f auto merge of #7147 : huonw/rust/vec-connect, r=Aatch
This is caused by StrVector having a generic implementation for &[S]
and so #5898 means that method resolution of ~[~[1]].concat() sees that
both StrVector and VectorVector have methods that (superficially) match.

They are now connect_vec and concat_vec, which means that they can actually be
called.
2013-06-15 06:54:59 -07:00
bors
ac6f15417d auto merge of #7130 : huonw/rust/rustdoc-highlight, r=thestinger
This means that type definitions and function signatures have
pretty colours.
2013-06-15 05:49:02 -07:00
bors
6df66c194d auto merge of #7109 : bblum/rust/rwlocks, r=brson
r? @brson

links to issues: #7065 the race that's fixed; #7066 the perf improvement I added. There are also some minor cleanup commits here.

To measure the performance improvement from replacing the exclusive with an atomic uint, I edited the ```msgsend-ring-rw-arcs``` bench test to do a ```write_downgrade``` instead of just a ```write```, so that it stressed the code paths that accessed ```read_count```. (At first I was still using ```write``` and saw no performance difference whatsoever, whoooops.)

The bench test measures how long it takes to send 1,000,000 messages by using rwarcs to emulate pipes. I also measured the performance difference imposed by the fix to the ```access_lock``` race (which involves taking an extra semaphore in the ```cond.wait()``` path). The net result is that fixing the race imposes a 4% to 5% slowdown, but doing the atomic uint optimization gives a 6% to 8% speedup.

Note that this speedup will be most visible in read- or downgrade-heavy workloads. If an RWARC's only users are writers, the optimization doesn't matter. All the same, I think this more than justifies the extra complexity I mentioned in #7066.

The raw numbers are:
```
with xadd read count
        before write_cond fix
                4.18 to 4.26 us/message
        with write_cond fix
                4.35 to 4.39 us/message
                
with exclusive read count
        before write_cond fix
                4.41 to 4.47 us/message
        with write_cond fix
                4.65 to 4.76 us/message
```
2013-06-15 04:07:03 -07:00
bors
da42e6b7a0 auto merge of #7133 : kballard/rust/terminfo-parm, r=thestinger
Implement conditional support in terminfo, along with a few other related operators.

Fix implementation of non-commutative arithmetic operators.

Remove all known cases of task failure from `terminfo::parm::expand`, and change the method signature.

Fix some other miscellaneous issues.
2013-06-15 03:07:05 -07:00
bors
83d44f87e5 auto merge of #7125 : alexcrichton/rust/rusti-issues, r=brson
This un-reverts the reverts of the rusti commits made awhile back. These were reverted for an LLVM failure in rustpkg. I believe that this is not a problem with these commits, but rather that rustc is being used in parallel for rustpkg tests (in-process). This is not working yet (almost! see #7011), so I serialized all the tests to run one after another.

@brson, I'm mainly just guessing as to the cause of the LLVM failures in rustpkg tests. I'm confident that running tests in parallel is more likely to be the problem than those commits I made.

Additionally, this fixes two recently reported issues with rusti.
2013-06-15 01:04:05 -07:00
bors
7d1065e913 auto merge of #7122 : thestinger/rust/std, r=luqmana 2013-06-14 23:37:08 -07:00
Tim Chevalier
e3c4104d74 rustpkg: Write more automated tests
Automate more tests described in the commands.txt file,
and add infrastructure for running them. Right now, tests shell
out to call rustpkg. This is not ideal.
2013-06-14 22:46:01 -07:00
Tim Chevalier
1adbb4520b rustc: Don't continue to resolve if there's an error in lang_items
This confused me when it happened.
2013-06-14 22:45:43 -07:00
bors
c83bceddbb auto merge of #7121 : huonw/rust/rand-call, r=pnkfelix
r? @pnkfelix
2013-06-14 22:37:13 -07:00
bors
1ba6fa4777 auto merge of #7110 : thestinger/rust/iterator, r=brson 2013-06-14 21:37:27 -07:00
Huon Wilson
18542568a8 std: rename .connect/.concat in VectorVector to avoid conflicting with StrVector.
This is caused by StrVector having a generic implementation for &[S]
and so #5898 means that method resolution of ~[~[1]].concat() sees that
both StrVector and VectorVector have methods that (superficially) match.

They are now connect_vec and concat_vec, which means that they can actually be
called.
2013-06-15 14:15:56 +10:00
bors
1104e659d5 auto merge of #7144 : dotdash/rust/caches, r=graydon
The lookups for these items in external crates currently cause repeated
decoding of the EBML metadata, which is pretty slow. Adding caches to
avoid the repeated decoding reduces the time required for the type
checking of librustc by about 25%.
2013-06-14 20:28:09 -07:00
Daniel Micay
824a6277af rm CopyableNonstrictIter
copies can just be done explicitly: `xs.transform(|x|x.clone())`
2013-06-14 23:15:42 -04:00
Daniel Micay
d68be89e69 rm MutableIter
replaced with mutable implementations of Iterator
2013-06-14 23:15:42 -04:00
Daniel Micay
8111701604 rm ExtendedMutableIter
replaced with `xs.mut_iter().enumerate()`
2013-06-14 23:15:42 -04:00
Daniel Micay
585f5f7f79 add IteratorUtil to the prelude 2013-06-14 23:15:42 -04:00
Björn Steinbrink
a710e61903 Add caches for method and impl metadata
The lookups for these items in external crates currently cause repeated
decoding of the EBML metadata, which is pretty slow. Adding caches to
avoid the repeated decoding reduces the time required for the type
checking of librustc by about 25%.
2013-06-15 04:28:19 +02:00
bors
104e6120b1 auto merge of #7116 : thestinger/rust/whitespace, r=luqmana 2013-06-14 19:25:05 -07:00
Brian Anderson
38e05747b5 xfail run-pass/auto-encode.rs 2013-06-14 16:50:53 -07:00
Kevin Ballard
da4e614742 Fix line lengths in terminfo 2013-06-14 13:03:42 -07:00
Kevin Ballard
f31767df66 Implement terminfo param conditionals
Implement the %?, %t, %e, and %; operators. Also implement the %<, %=,
%> operators, without which conditionals aren't very useful.

Fix the order of parameters for the arithmetic operators.

Implement the missing %^ operator.
2013-06-14 12:37:54 -07:00
Kevin Ballard
6423548818 Fix a bunch of failure cases in terminfo
Replace all potentially-failing operations with Err returns and add
tests.

Remove the Char parameter type; characters are represented as Numbers.

Fix integer constants to work properly when there are multiple constants
in the same capability string.

Tweak loop to use iterators instead of indexing into cap.
2013-06-14 12:37:54 -07:00
Kevin Ballard
e990239a3a Don't require &mut [Param] with terminfo::parm::expand() 2013-06-14 12:37:53 -07:00
Kevin Ballard
c9e234a1ae Tweak terminfo::parm::expand function signature
Take a new struct Variables instead of two &mut [] vectors for static
and dynamic variables.
2013-06-14 12:37:53 -07:00
Kevin Ballard
9f9e505405 Tweak new terminfo logical operator support 2013-06-14 12:37:53 -07:00
Corey Richardson
821a962feb Various terminfo parameterization changes 2013-06-14 12:37:53 -07:00
Huon Wilson
d361802540 rustdoc: add syntax highlighting to item signatures.
This means that type definitions and function signatures have
pretty colours.

It uses the following template:

~~~ {.rust}
<code>
~~~
2013-06-15 02:19:19 +10:00
Graydon Hoare
eadd83da8b Merge pull request #7129 from erickt/fix-std-path-tests
std: get std::path tests to work again
2013-06-14 09:06:56 -07:00
Erick Tryzelaar
f7e1daa8e3 std: get std::path tests to work again 2013-06-14 07:13:32 -07:00
Alex Crichton
9c3b1cbc19 Resolve LLVM crashing in rustpkg tests 2013-06-13 22:53:30 -07:00
Alex Crichton
dc18321ef5 Don't run passes again on JIT code
These passes are already run beforehand, no need to do them twice.
2013-06-13 22:53:10 -07:00
Alex Crichton
079ffa362f Correctly parse commands for rusti
Closes #7120
2013-06-13 21:48:16 -07:00
Alex Crichton
a90fffe367 Revert "Revert "Have JIT execution take ownership of the LLVMContextRef""
This reverts commit 19adece68b.
2013-06-13 21:25:18 -07:00
Alex Crichton
1a3edecbf2 Revert "Revert "Remove all usage of the global LLVMContextRef""
This reverts commit 541c657a73.
2013-06-13 21:25:12 -07:00
Brian Anderson
7755018074 Revert "std: convert {vec,str}::to_owned to methods."
This fixes the strange random crashes in compile-fail tests.

This reverts commit 96cd61ad03.

Conflicts:
	src/librustc/driver/driver.rs
	src/libstd/str.rs
	src/libsyntax/ext/quote.rs
2013-06-13 19:06:47 -07:00
Daniel Micay
2b13606d9f update the libstd docstring for the rename 2013-06-13 21:41:11 -04:00
Huon Wilson
8431e609ea xfail test on windows, because extern mod doesn't work there 2013-06-14 11:12:06 +10:00
Huon Wilson
e6c3e4a000 syntax: revert the uint -> u32 "fix"; make the names/comment match. 2013-06-14 11:12:06 +10:00
Huon Wilson
f93a974558 syntax: correct the Rand::rand call to select enum variants in #[deriving(Rand)].
Previously, this was not a global call, and so when `#[deriving(Rand)]`
was in any module other than the top-level one, it failed (unless there
was a `use std;` in scope).

Also, fix a minor inconsistency between uints and u32s for this piece
of code.
2013-06-14 11:12:06 +10:00
Daniel Micay
ec27644870 automated whitespace fixes 2013-06-13 18:03:08 -04:00
Graydon Hoare
b417bc8511 Update CONTRIBUTING.md 2013-06-13 15:41:34 -06:00
Brian Anderson
541c657a73 Revert "Remove all usage of the global LLVMContextRef"
This reverts commit 779191cd4b.

Conflicts:
	src/librustc/middle/trans/base.rs
	src/librustc/middle/trans/common.rs
2013-06-13 13:08:57 -07:00
Brian Anderson
19adece68b Revert "Have JIT execution take ownership of the LLVMContextRef"
This reverts commit 5c5095d25e.

Conflicts:
	src/librusti/rusti.rc
2013-06-13 13:08:57 -07:00
Ben Blum
2ef8774ac5 Improve comments in sync and arc a bit more. 2013-06-13 15:20:38 -04:00
bors
5bff471dde auto merge of #7105 : sstewartgallus/rust/removed_unused_imports, r=sanxiyn
I was able to remove unused imports, and fix the following warnings

src/libstd/hashmap.rs:23:15: 23:23 warning: unused import [-W unused-imports (default)]
src/libstd/task/spawn.rs:95:15: 95:23 warning: unused import [-W unused-imports (default)]
src/libstd/rt/uv/mod.rs:42:0: 42:9 warning: unused import [-W unused-imports (default)]
src/libstd/rt/uv/mod.rs:45:0: 45:9 warning: unused import [-W unused-imports (default)]
src/librustc/middle/trans/meth.rs:26:0: 26:26 warning: unused import [-W unused-imports (default)]
src/librustc/back/link.rs:210:20: 210:25 warning: unused import [-W unused-imports (default)]

I was unable to fix the following unused import warnings. The code
here was weird.

src/libextra/std.rc:40:11: 40:14 warning: unused import [-W unused-imports (default)]
src/libextra/std.rc:40:16: 40:24 warning: unused import [-W unused-imports (default)]
2013-06-13 12:08:05 -07:00
Ben Blum
57cb44dbeb Change sync::RWlock implementation to use atomic uint instead of exclusive, for performance. Close #7066. 2013-06-13 14:45:14 -04:00
Ben Blum
68e8fe9b6e Add a test case for #7065. 2013-06-13 14:41:22 -04:00
Ben Blum
bd019c4c26 Thread order_lock through rwlock condvars for reacquiring access_lock. Fixes #7065. 2013-06-13 14:41:20 -04:00