Commit Graph

32197 Commits

Author SHA1 Message Date
NODA, Kai
52e99cbcaa libnative/io: generic retry() for Unix 64 bit read/write().
Win32/WinSock APIs never call WSASetLastError() with WSAEINTR
unless a programmer specifically cancels the ongoing blocking call by
a deprecated WinSock1 API WSACancelBlockingCall().
So the errno check was simply removed and retry() became an id function
on Windows.
Note: Windows' equivalent of SIGINT is always handled in a separate thread:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682541%28v=vs.85%29.aspx
"CTRL+C and CTRL+BREAK Signals"

Also, incidentally rename a type parameter and clean up some module imports.
2014-09-08 08:17:13 +08:00
Alex Crichton
6c5c1ee34f rustdoc: Don't strip #-lines if notrust
Other languages may not want to have a leading #-line get stripped.
2014-09-07 17:01:16 -07: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
Dan Albert
8c3db5bc53 Allow Rust to be built with LLVM trunk (3.6). 2014-09-07 14:42:48 -07: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
Jakub Wieczorek
c98a80e472 Fix casts in constant expressions
Fixes #17074.
2014-09-07 21:24:18 +02: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
Jonas Hietala
248319a52e Flip arguments to std::iter::iterate.
Breaks `iterate(f, seed)`, use `iterate(seed, f)` instead.
The convention is to have the closure last.

Closes #17066.

[breaking-change]
2014-09-07 19:44:30 +02:00
Guillaume Pinot
4894c21759 Relicense shootout-nbody.rs to the shootout license
Everyone agreed. fix #17073
2014-09-07 19:16:55 +02: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
Guillaume Pinot
0b2e6f8087 Relicense shootout-reverse-complement.rs to the shootout license.
Everyone agreed.  Fix #17065
2014-09-07 18:09:01 +02: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
Nathan Typanski
fda2319068 Add regression test for issue #10766
This test verifies that casting from the same lifetime on a value
to the same lifetime on a trait succeeds. Closes #10766.
2014-09-07 03:59:02 -04:00
Nathan Typanski
d80729a8e4 Add ICE regression test for issue #16218.
This code used to produce an ICE on the definition of trait Bar
with the following message:

Type parameter out of range when substituting in region 'a (root
type=fn(Self) -> 'astr) (space=FnSpace, index=0)

Closes #16218.
2014-09-07 03:58:35 -04: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
Piotr Czarnecki
808e039d40 Fix ICE with trans of calls to foreign fns
It was failing occasionally.
2014-09-06 12:31:05 +01:00
Piotr Czarnecki
10935de0cd rustc: Refactor middle::trans::inline 2014-09-06 12:31:05 +01:00
bors
a356e98803 auto merge of #16997 : gamazeps/rust/master, r=huonw
Changed the names according to the issue #16988
2014-09-06 10:31:29 +00:00
bors
20c0ba1279 auto merge of #16907 : SimonSapin/rust/tempdir-result, r=huonw
This allows using `try!()`

[breaking-change]

Fixes #16875
2014-09-06 08:01:33 +00:00
bors
4bea7b3ed0 auto merge of #16367 : epdtry/rust/parallel-codegen, r=alexcrichton
This branch adds support for running LLVM optimization and codegen on different parts of a crate in parallel.  Instead of translating the crate into a single LLVM compilation unit, `rustc` now distributes items in the crate among several compilation units, and spawns worker threads to optimize and codegen each compilation unit independently.  This improves compile times on multicore machines, at the cost of worse performance in the compiled code.  The intent is to speed up build times during development without sacrificing too much optimization.

On the machine I tested this on, `librustc` build time with `-O` went from 265 seconds (master branch, single-threaded) to 115s (this branch, with 4 threads), a speedup of 2.3x.  For comparison, the build time without `-O` was 90s (single-threaded).  Bootstrapping `rustc` using 4 threads gets a 1.6x speedup over the default settings (870s vs. 1380s), and building `librustc` with the resulting stage2 compiler takes 1.3x as long as the master branch (44s vs.  55s, single threaded, ignoring time spent in LLVM codegen).

The user-visible changes from this branch are two new codegen flags:

 * `-C codegen-units=N`: Distribute items across `N` compilation units.
 * `-C codegen-threads=N`: Spawn `N` worker threads for running optimization and codegen.  (It is possible to set `codegen-threads` larger than `codegen-units`, but this is not very useful.)

Internal changes to the compiler are described in detail on the individual commit messages.

Note: The first commit on this branch is copied from #16359, which this branch depends on.

r? @nick29581
2014-09-06 06:06:35 +00:00
bors
da1395b6cb auto merge of #17039 : vadimcn/rust/test_lots_of_files, r=alexcrichton 2014-09-06 03:31:34 +00:00
Vadim Chugunov
6a7e6017c5 Disable test_lots_of_files on Windows 2014-09-05 19:55:25 -07:00
Huon Wilson
9151874f40 Use more jQuery to avoid displaying Expand Description more often.
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-06 11:04:39 +10:00
jamesluke
4755441fd4 Fix documentation typo. 2014-09-05 16:03:58 -07:00
Stuart Pernsteiner
6d2d47b2fc don't use ld -r with -C codegen-units=1 2014-09-05 14:30:36 -07:00
Brian Anderson
7e12e67936 Optimize Slice::reverse
This makes the completely safe implementation of fannkuchredux perform
the same as C++. Yay, Rust.
2014-09-05 14:12:20 -07:00
Robert Gawdzik ☢
5eea93af39 Fixes type range issue during linting (#16684)
- Ensures the propagated negation sign is properly utilized during type
   checking.
 - Removed redundant type checking, specifically regarding the out of bounds checking
   on a bounded type.
 - Closes #16684
2014-09-05 14:59:39 -04:00