Commit Graph

32107 Commits

Author SHA1 Message Date
Alex Crichton
679b4e1b38 rollup merge of #16971 : treeman/json-decode 2014-09-09 12:07:11 -07:00
bors
b625d43f8f auto merge of #16927 : dotdash/rust/llvmup, r=alexcrichton 2014-09-09 17:16:18 +00:00
bors
504ed55775 auto merge of #16827 : steveklabnik/rust/fix_doc_index, r=brson
Fixes #14972
2014-09-09 13:26:16 +00:00
bors
3884f5fc8e auto merge of #16965 : huonw/rust/isaac-oob--, r=alexcrichton
rand: inform the optimiser that indexing is never out-of-bounds.

This uses a bitwise mask to ensure that there's no bounds checking for
the array accesses when generating the next random number. This isn't
costless, but the single instruction is nothing compared to the branch.

A `debug_assert` for "bounds check" is preserved to ensure that
refactoring doesn't accidentally break it (i.e. create values of `cnt`
that are out of bounds with the masking causing it to silently wrap-
around).

Before:

test test::rand_isaac   ... bench: 990 ns/iter (+/- 24) = 808 MB/s
test test::rand_isaac64 ... bench: 614 ns/iter (+/- 25) = 1302 MB/s

After:

test test::rand_isaac   ... bench: 877 ns/iter (+/- 134) = 912 MB/s
test test::rand_isaac64 ... bench: 470 ns/iter (+/- 30) = 1702 MB/s

(It also removes the unsafe code in Isaac64Rng.next_u64, with a *gain*
in performance; today is a good day.)
2014-09-09 11:11:17 +00:00
bors
7ab58f67d1 auto merge of #17083 : thestinger/rust/jemalloc, r=alexcrichton
The performance hit from these checks is significant, but unoptimized
builds are already incredibly slow. Enabling these checks results in
better test coverage since there are bots doing unoptimized builds, and
the cost is relatively small in the context of an unoptimized build.
This also allows using `JEMALLOC_FLAGS` to override the default
configure flags.
2014-09-09 07:56:19 +00:00
Jonas Hietala
4f4a3dfb1a Decoding json now defaults Option<_> to None.
Closes #12794
2014-09-09 07:28:59 +02:00
bors
641b1980a4 auto merge of #16825 : steveklabnik/rust/fix_manual_array_terms, r=brson
fixes #16015
2014-09-09 04:26:18 +00:00
bors
325808a33d auto merge of #16952 : alexcrichton/rust/windows-large-console-write, r=brson
I've found that 64k is still too much and continue to see the errors as reported
in #14940. I've locally found that 32k fails, and 24k succeeds, so I've trimmed
the size down to 10000 which the included links in the added comment end up
recommending.

It sounds like the limit can still be hit with many threads in play, but I have
yet to reproduce this, so I figure we can wait until that's hit (if it's
possible) and then take action.
2014-09-08 20:51:14 +00:00
Alex Crichton
198030fadf std: Turn down the stdout chunk size
I've found that 64k is still too much and continue to see the errors as reported
in #14940. I've locally found that 32k fails, and 24k succeeds, so I've trimmed
the size down to 8192 which libuv happens to use as well.

It sounds like the limit can still be hit with many threads in play, but I have
yet to reproduce this, so I figure we can wait until that's hit (if it's
possible) and then take action.
2014-09-08 12:54:32 -07:00
bors
0c73e5fc5f auto merge of #12809 : eddyb/rust/ty-arena, r=cmr
This was inspired by seeing a LLVM flatline of **~600MB** when running rustc with jemalloc (each type's `t_box_` is allocated on the heap, creating a lot of fragmentation, which jemalloc can deal with, unlike glibc).
2014-09-08 15:36:13 +00:00
Björn Steinbrink
cdfa637dad Update LLVM to fix a crash in the MergeFunc pass 2014-09-08 17:07:03 +02:00
bors
6f34760e41 auto merge of #16903 : mahkoh/rust/move_items_unwrap, r=aturon
Closes #16879
2014-09-08 13:46:15 +00:00
Eduard Burtescu
8bfbcddf53 rustdoc: fix fallout from the addition of a 'tcx lifetime on tcx. 2014-09-08 15:28:25 +03:00
Eduard Burtescu
f7a997be05 rustc: fix fallout from the addition of a 'tcx lifetime on trans::Block. 2014-09-08 15:28:24 +03:00
Eduard Burtescu
28be695b2c rustc: fix fallout from the addition of a 'tcx lifetime on tcx. 2014-09-08 15:28:23 +03:00
Eduard Burtescu
22f8b8462e rustc: use a TypedArena to allocate types in the type context. 2014-09-08 15:14:10 +03:00
bors
5c3987985e auto merge of #17053 : thestinger/rust/large_address_aware, r=sfackler,cmr
By default, 32-bit Windows executables are restricted to 2GiB of address
space even when running on 64-bit Windows when 4GiB is available.

Closes #17043
2014-09-08 11:56:12 +00:00
bors
ab7b1c896d auto merge of #17063 : huonw/rust/snap, r=alexcrichton
Closes #16880.
2014-09-08 10:06:15 +00:00
Huon Wilson
cc6a4877a4 rand: inform the optimiser that indexing is never out-of-bounds.
This uses a bitwise mask to ensure that there's no bounds checking for
the array accesses when generating the next random number. This isn't
costless, but the single instruction is nothing compared to the branch.

A `debug_assert` for "bounds check" is preserved to ensure that
refactoring doesn't accidentally break it (i.e. create values of `cnt`
that are out of bounds with the masking causing it to silently wrap-
around).

Before:

    test test::rand_isaac   ... bench: 990 ns/iter (+/- 24) = 808 MB/s
    test test::rand_isaac64 ... bench: 614 ns/iter (+/- 25) = 1302 MB/s

After:

    test test::rand_isaac   ... bench: 877 ns/iter (+/- 134) = 912 MB/s
    test test::rand_isaac64 ... bench: 470 ns/iter (+/- 30) = 1702 MB/s

(It also removes the unsafe code in Isaac64Rng.next_u64, with a *gain*
in performance; today is a good day.)
2014-09-08 19:33:37 +10:00
bors
a39f69f91d auto merge of #17036 : pczarn/rust/issue-15913-ICE-with-call-trans, r=alexcrichton
A match in callee.rs was recognizing some foreign fns as named tuple constructors. A reproducible test case for this is nearly impossible since it depends on the way NodeIds happen to be assigned in different crates.

Fixes #15913
2014-09-08 08:06:18 +00:00
bors
dd626b48c4 auto merge of #16933 : nick29581/rust/dst-rvalue, r=nikomatsakis
Closes #16813 

r? @nikomatsakis I feel like I should be checking more things in check_rvalues, but not sure what - I don't properly understand expr_use_visitor
2014-09-08 02:36:15 +00:00
bors
aaf141d399 auto merge of #16942 : alexcrichton/rust/remove-net-assert, r=brson
This assert was likely inherited from some point, but it's not quite valid as a
no-timeout read may enter this loop, but data could be stolen by any other read
after the socket is deemed readable.

I saw this fail in a recent bors run where the assertion was tripped.
2014-09-07 23:01:34 +00:00
Nick Cameron
742f49c961 Forbid unsized rvalues
Closes #16813
2014-09-08 09:32:52 +12:00
bors
19dc574890 auto merge of #17035 : huonw/rust/moar-jquery, r=alexcrichton
Sometimes (e.g. on Rust CI) the "expand description" text of the
collapse toggle was displayed by default, when a page is first
loaded (even though the description is expanded), because some
Content-Security-Policy settings disable inline CSS.

Setting it the style with the `.css` method allows the output to be used
in more places.
2014-09-07 21:06:29 +00:00
bors
86730e43c0 auto merge of #16904 : inrustwetrust/rust/link-path-order, r=alexcrichton
Issue can be reproduced by the following:
```
$ cat main.rs
fn main() {}
$ rustc -Z print-link-args -Lfoo -Lbar main.rs
```
Run the rustc command a few times and observe that the order of the '-L' 'foo' '-L' 'bar' options randomly changes.

Actually hit this issue in practice on Windows when specifying two -L directories to rustc, one with rust-sdl2 in it and one with the C SDL2.dll. Since Windows file systems aren't case-sensitive, gcc randomly attempted to link against the rust sdl2.dll instead of SDL2.dll if that -L directory happened to come first.

The randomness was due to addl_lib_search_paths being a HashSet. Changed it to a Vec instead which maintains the ordering.
Unsure how to test this though since it is random by nature; suggestions very welcome.
2014-09-07 19:06:28 +00:00
Daniel Micay
1ee099da36 enable jemalloc debugging in unoptimized builds
The performance hit from these checks is significant, but unoptimized
builds are already incredibly slow. Enabling these checks results in
better test coverage since there are bots doing unoptimized builds, and
the cost is relatively small in the context of an unoptimized build.
This also allows using `JEMALLOC_FLAGS` to override the default
configure flags.
2014-09-07 14:23:48 -04:00
bors
d7502ac2d6 auto merge of #17015 : seb-m/rust/fix-extern-crate-as, r=sfackler
Its arguments were inverted.

For instance it displayed this message:

```
warning: this extern crate syntax is deprecated. Use: extern create "foobar" as foo;
```

Instead of:

```
warning: this extern crate syntax is deprecated. Use: extern create "foo" as foobar;
```
2014-09-07 16:21:29 +00:00
Sebastien Martini
8baff54128 Fix deprecate warning "extern crate ... as ..."
Its arguments were inverted.
2014-09-07 17:58:33 +02:00
bors
4067252def auto merge of #17034 : retep998/rust/glob-fix, r=alexcrichton
Fixes #15279
Based on #13338
2014-09-07 14:31:24 +00:00
bors
1242772cce auto merge of #17005 : bjz/rust/bit-count, r=thestinger
Fixes rust-lang/rfcs#224
2014-09-07 12:41:25 +00:00
Huon Wilson
524e1b20af Register snapshots.
Closes #16880.
2014-09-07 20:42:14 +10:00
inrustwetrust
e7a000e717 Added test for link path ordering 2014-09-07 11:42:02 +02:00
inrustwetrust
61414a9850 Changed addl_lib_search_paths from HashSet to Vec
This makes the extra library paths given to the gcc linker come in
the same order as the -L options on the rustc command line.
2014-09-07 11:42:02 +02:00
Steve Klabnik
a021330b1d Fix vector/array/slice terminology in manual.
Fixes #16015.
2014-09-07 05:28:59 -04:00
bors
ee72e46638 auto merge of #17032 : jamesluke/rust/master, r=alexcrichton
"extern create" -> "extern crate"
2014-09-07 09:26:27 +00:00
bors
57781c3c30 auto merge of #17019 : steveklabnik/rust/remove_compromise, r=thestinger
@dherman doesn't like it 😄
2014-09-07 07:16:27 +00:00
bors
c964cb229b auto merge of #17018 : steveklabnik/rust/fix_projects_in_guide, r=huonw
Thanks @dherman.
2014-09-07 05:31:25 +00:00
bors
d52d0c8364 auto merge of #17016 : steveklabnik/rust/fix_diagnostic_codes, r=huonw
Fixes #16449.
2014-09-07 03:36:27 +00:00
bors
09cebc25a3 auto merge of #16999 : brson/rust/fannkuch, r=alexcrichton
From the discussion on reddit:
http://www.reddit.com/r/rust/comments/2fenlg/benchmark_improvement_fannkuchredux/

This adds two variants: the primary, that uses an unsafe block, and a secondary
that is completely safe.

The one with the unsafe block matches clang's performance and beats gcc's.
2014-09-07 00:31:28 +00:00
Daniel Micay
c6633fde53 mark win32 binaries as large address aware
By default, 32-bit Windows executables are restricted to 2GiB of address
space even when running on 64-bit Windows when 4GiB is available.

Closes #17043
2014-09-06 17:54:52 -04:00
bors
38eb0e5514 auto merge of #17012 : thestinger/rust/sized, r=nikomatsakis 2014-09-06 21:46:25 +00:00
Daniel Micay
c76e3caf10 fix sized deallocation for TypedArena<T> 2014-09-06 13:58:34 -04:00
Daniel Micay
2fdad65a05 fix sized deallocation for OwnedSlice 2014-09-06 13:58:34 -04:00
Daniel Micay
d1bd139251 fix sized deallocation for Box<[T]> 2014-09-06 13:58:30 -04:00
bors
d8a26184dc auto merge of #17011 : nodakai/rust/rustdoc-stronger-crate, r=alexcrichton
If you browse to, say, http://doc.rust-lang.org/libc/types/os/common/posix01/struct.timeval.html , you will see the "location" window showing `libc::types::os::common::posix01`.  The first element points to a crate and others point modules.  This patch adds the bold attribute to the first (ie. crate) element so that it stands out more.
2014-09-06 17:51:24 +00:00
Daniel Micay
5aa2da0133 fix sized deallocation for proc 2014-09-06 13:50:58 -04:00
Daniel Micay
395e453c06 fix a sized deallocation issue in the glue code 2014-09-06 13:50:58 -04:00
Peter Atashian
d3ec0674bb readdir: return error instead of failing on invalid UTF-16
Fixes #15279

Signed-off-by: Peter Atashian <retep998@gmail.com>
2014-09-06 12:51:42 -04:00
bors
6eabd85265 auto merge of #17003 : nick29581/rust/impl, r=pcwalton
closes #16955 

r? @pcwalton
2014-09-06 14:51:26 +00:00
bors
9f2ba967a0 auto merge of #17002 : tari/rust/std-mut-ref-slice, r=alexcrichton
`std::slice` exported `ref_slice` but not `mut_ref_slice`. This change makes it export both.
2014-09-06 13:06:27 +00:00