]> git.lizzy.rs Git - rust.git/log
rust.git
9 years agonative: clone/close_accept for win32 pipes
Alex Crichton [Tue, 15 Jul 2014 19:42:40 +0000 (12:42 -0700)]
native: clone/close_accept for win32 pipes

This commits takes a similar strategy to the previous commit to implement
close_accept and clone for the native win32 pipes implementation.

Closes #15595

9 years agonative: Add some documentation for accept
Alex Crichton [Tue, 15 Jul 2014 18:06:31 +0000 (11:06 -0700)]
native: Add some documentation for accept

Document the new code for how close_accept and timeouts are implemented.

9 years agonative: TCP close/close_accept for windows
Alex Crichton [Tue, 15 Jul 2014 17:28:00 +0000 (10:28 -0700)]
native: TCP close/close_accept for windows

This commit implements TcpAcceptor::{close, close_accept} for windows via
WSAEVENT types.

9 years agorustuv: Implement clone/close_accept
Alex Crichton [Tue, 15 Jul 2014 05:48:05 +0000 (22:48 -0700)]
rustuv: Implement clone/close_accept

This commits implements {Tcp,Unix}Acceptor::{clone,close_accept} methods for
all of librustuv.

This implementation rewrites much of Access, AccessTimeout, and AcceptTimeout to
have type parameter for shared state that all acceptors share (a shared queue of
sockets). The incoming/outgoing channels have been removed as all timeouts and
such are now managed on the event loop rather than concurrently.

9 years agonative: Implement clone/close_accept for unix
Alex Crichton [Fri, 11 Jul 2014 21:29:15 +0000 (14:29 -0700)]
native: Implement clone/close_accept for unix

This commits implements {Tcp,Unix}Acceptor::{clone,close_accept} methods for
unix. A windows implementation is coming in a later commit.

The clone implementation is based on atomic reference counting (as with all
other clones), and the close_accept implementation is based on selecting on a
self-pipe which signals that a close has been seen.

9 years agoauto merge of #16646 : P1start/rust/trailing-commas, r=alexcrichton
bors [Sun, 24 Aug 2014 22:16:00 +0000 (22:16 +0000)]
auto merge of #16646 : P1start/rust/trailing-commas, r=alexcrichton

This lets the parser understand trailing commas in method calls, method definitions, enum variants, and type parameters.

Closes #14240.
Closes #15887.

9 years agoauto merge of #16718 : Sawyer47/rust/bool-cast, r=pcwalton
bors [Sun, 24 Aug 2014 20:30:59 +0000 (20:30 +0000)]
auto merge of #16718 : Sawyer47/rust/bool-cast, r=pcwalton

Current version of rust fails when casting from bool, e.g.
```rust
fn main() {
    let _a = false as uint;
    let _b = true as uint;
    let _c: [bool, ..false as uint];
    let _d: [bool, ..true as uint];
    // _a and _b work, but _c and _d result in an error
    // error: expected constant expr for vector length: can't cast str to uint
}
```
This commit makes it work as expected.

9 years agoauto merge of #16728 : bluss/rust/zip-next-back, r=alexcrichton
bors [Sun, 24 Aug 2014 18:46:01 +0000 (18:46 +0000)]
auto merge of #16728 : bluss/rust/zip-next-back, r=alexcrichton

Use ExactSize::len() and defer to its decisions about overly defensive
assertions. Remove the length double-check and simply put a failure
case if the Zip finds an uneven end in .next_back().

Fixing this up since I think I wrote this, and it's been known to
confuse rusties (PR #15886).

9 years agoauto merge of #16730 : tshepang/rust/typos, r=pcwalton
bors [Sun, 24 Aug 2014 17:01:06 +0000 (17:01 +0000)]
auto merge of #16730 : tshepang/rust/typos, r=pcwalton

9 years agodoc: fix some typos in the Guide
Tshepang Lekhonkhobe [Sun, 24 Aug 2014 15:22:10 +0000 (17:22 +0200)]
doc: fix some typos in the Guide

9 years agoauto merge of #16722 : tshepang/rust/trailing-spaces, r=pcwalton
bors [Sun, 24 Aug 2014 13:51:03 +0000 (13:51 +0000)]
auto merge of #16722 : tshepang/rust/trailing-spaces, r=pcwalton

9 years agolibcore: Simplify Enumerate, Zip::next_back
root [Sun, 24 Aug 2014 13:04:28 +0000 (15:04 +0200)]
libcore: Simplify Enumerate, Zip::next_back

Use ExactSize::len() and defer to its decisions about overly defensive
assertions. Remove the length double-check and simply put a failure
case if the Zip finds an uneven end in .next_back().

Fixing this up since I think I wrote this, and it's been known to
confuse rusties (PR#15886).

9 years agoauto merge of #16717 : tshepang/rust/misplaced-comma, r=pcwalton
bors [Sun, 24 Aug 2014 11:16:02 +0000 (11:16 +0000)]
auto merge of #16717 : tshepang/rust/misplaced-comma, r=pcwalton

Also:

* Remove unseeming repetition.
* By now, the reader has already heard that Rust is safe by default, so
reduce the overlong sentence, making it easier to read.

9 years agodoc: remove trailing spaces from Guide
Tshepang Lekhonkhobe [Sun, 24 Aug 2014 10:26:45 +0000 (12:26 +0200)]
doc: remove trailing spaces from Guide

9 years agoauto merge of #16710 : dotdash/rust/mergefunc, r=thestinger
bors [Sun, 24 Aug 2014 09:30:56 +0000 (09:30 +0000)]
auto merge of #16710 : dotdash/rust/mergefunc, r=thestinger

Fixes #9536

---

From https://github.com/rust-lang/rust/issues/9536#issuecomment-45495670:

I've built rustc with the aforementioned fix, once with MergeFunc being run early (that's what the patch for clang that comes  with LLVM does), and once with MergeFunc being run late (using `-C passes=mergefunc`). Here are some time/code size measurements I made with them:

Build command: `rustc -O -o /dev/null --emit asm .../lib.rs`

CPU (user) times, best of three runs:

 Crate       | No MergeFunc | Early MergeFunc | Late MergeFunc
-------------|--------------|-----------------|---------------
 core        |    5.380s    |    5.476s       |    5.364s
 collections |    1.884s    |    1.856s       |    1.892s
 native      |    7.200s    |    7.356s       |    7.108s
 rustc       | 3m23.584s    | 3m28.120s       | 3m21.820s
 std         |   13.888s    |   13.976s       |   13.848s
 syntax      |   48.992s    |   47.752s       |   48.372s

Sizes:

Crate                                    | No MergeFunc |   Early MergeFunc   |    Late MergeFunc
-----------------------------------------|-------------:|--------------------:|-------------------:
lib                                      |  237037581   |  236005998 (-0.44%) |  234708744 (-0.98%)
libarena-063bff73-0.11.0-pre.so          |      60398   |      60393 (-0.01%) |      60394 (-0.01%)
libcollections-d412c0c4-0.11.0-pre.so    |     971566   |     971772 (+0.02%) |     971691 (+0.01%)
libdebug-1e940314-0.11.0-pre.so          |     181352   |     181514 (+0.09%) |     181363 (+0.01%)
libflate-92afea7e-0.11.0-pre.so          |     137837   |     137869 (+0.02%) |     137837 (+0.00%)
libfmt_macros-5125f3bd-0.11.0-pre.so     |     132733   |     134598 (+1.41%) |     132465 (-0.20%)
libgetopts-c94737d1-0.11.0-pre.so        |     158851   |     157427 (-0.90%) |     158272 (-0.36%)
libgraphviz-7b3cf89d-0.11.0-pre.so       |      53337   |      53178 (-0.30%) |      53337 (+0.00%)
liblog-cd053230-0.11.0-pre.so            |      85993   |      86017 (+0.03%) |      85780 (-0.25%)
libnative-1fb5e2c0-0.11.0-pre.so         |     635785   |     639352 (+0.56%) |     621184 (-2.30%)
libregex-77385931-0.11.0-pre.so          |     450538   |     450741 (+0.05%) |     449504 (-0.23%)
librustc-d252d482-0.11.0-pre.so          |   51583741   |   51227703 (-0.69%) |   50930784 (-1.27%)
librustdoc-6ecbf63e-0.11.0-pre.so        |    4557104   |    4501896 (-1.21%) |    4394409 (-3.57%)
libserialize-0352aab7-0.11.0-pre.so      |    1126096   |    1115503 (-0.94%) |    1101734 (-2.16%)
libstd-59beb4f7-0.11.0-pre.so            |    4499529   |    4488879 (-0.24%) |    4477710 (-0.48%)
libsync-305341d2-0.11.0-pre.so           |     306767   |     312211 (+1.77%) |     304086 (-0.87%)
libsyntax-555559ea-0.11.0-pre.so         |    6699751   |    6632291 (-1.01%) |    6596232 (-1.55%)
libterm-4e4945a5-0.11.0-pre.so           |     389390   |     392689 (+0.85%) |     385525 (-0.99%)
libtest-a79f950d-0.11.0-pre.so           |     740161   |     730673 (-1.28%) |     734534 (-0.76%)
libtime-4bb3739b-0.11.0-pre.so           |     131518   |     132830 (+1.00%) |     131514 (-0.00%)
rustlib                                  |  164131038   |  163594366 (-0.33%) |  162796293 (-0.81%)
x86_64-unknown-linux-gnu                 |  164119867   |  163583195 (-0.33%) |  162785122 (-0.81%)
lib                                      |  164115771   |  163579099 (-0.33%) |  162781026 (-0.81%)
liballoc-1085c790-0.11.0-pre.rlib        |    1094410   |    1094444 (+0.00%) |    1094438 (+0.00%)
libarena-063bff73-0.11.0-pre.rlib        |     312324   |     312152 (-0.06%) |     312210 (-0.04%)
libarena-063bff73-0.11.0-pre.so          |      60394   |      60394 (+0.00%) |      60394 (+0.00%)
libcollections-d412c0c4-0.11.0-pre.rlib  |    7048646   |    7049094 (+0.01%) |    7048856 (+0.00%)
libcollections-d412c0c4-0.11.0-pre.so    |     971575   |     971771 (+0.02%) |     971681 (+0.01%)
libcompiler-rt.a                         |     573802   |     573802 (+0.00%) |     573802 (+0.00%)
libcore-c5ed6fb4-0.11.0-pre.rlib         |   24204746   |   24209820 (+0.02%) |   24187602 (-0.07%)
libdebug-1e940314-0.11.0-pre.rlib        |     876616   |     878488 (+0.21%) |     876746 (+0.01%)
libdebug-1e940314-0.11.0-pre.so          |     181352   |     181509 (+0.09%) |     181353 (+0.00%)
libflate-92afea7e-0.11.0-pre.rlib        |     175062   |     175074 (+0.01%) |     175082 (+0.01%)
libflate-92afea7e-0.11.0-pre.so          |     137837   |     137869 (+0.02%) |     137837 (+0.00%)
libfmt_macros-5125f3bd-0.11.0-pre.so     |     132724   |     134599 (+1.41%) |     132469 (-0.19%)
libfourcc-cc0e8bf1-0.11.0-pre.so         |     125828   |     126084 (+0.20%) |     125827 (-0.00%)
libgetopts-c94737d1-0.11.0-pre.rlib      |     864664   |     853040 (-1.34%) |     862548 (-0.24%)
libgetopts-c94737d1-0.11.0-pre.so        |     158855   |     157425 (-0.90%) |     158275 (-0.37%)
libglob-eafe1d22-0.11.0-pre.rlib         |     951370   |     944674 (-0.70%) |     946734 (-0.49%)
libglob-eafe1d22-0.11.0-pre.so           |     159130   |     157385 (-1.10%) |     156791 (-1.47%)
libgraphviz-7b3cf89d-0.11.0-pre.rlib     |     269600   |     269062 (-0.20%) |     269560 (-0.01%)
libgraphviz-7b3cf89d-0.11.0-pre.so       |      53334   |      53176 (-0.30%) |      53337 (+0.01%)
libgreen-ca0d0b80-0.11.0-pre.rlib        |    1374120   |    1389510 (+1.12%) |    1361696 (-0.90%)
libgreen-ca0d0b80-0.11.0-pre.so          |     372435   |     377929 (+1.48%) |     370991 (-0.39%)
libhexfloat-3b978f48-0.11.0-pre.so       |     131926   |     132166 (+0.18%) |     131935 (+0.01%)
liblibc-4f9a876d-0.11.0-pre.rlib         |     617472   |     617472 (+0.00%) |     617472 (+0.00%)
liblog-cd053230-0.11.0-pre.rlib          |     371190   |     371048 (-0.04%) |     370836 (-0.10%)
liblog-cd053230-0.11.0-pre.so            |      85996   |      86020 (+0.03%) |      85781 (-0.25%)
libmorestack.a                           |       1388   |       1388 (+0.00%) |       1388 (+0.00%)
libnative-1fb5e2c0-0.11.0-pre.rlib       |    2233070   |    2264296 (+1.40%) |    2194920 (-1.71%)
libnative-1fb5e2c0-0.11.0-pre.so         |     635787   |     639341 (+0.56%) |     621184 (-2.30%)
libnum-ebe12db7-0.11.0-pre.rlib          |    2672318   |    2675292 (+0.11%) |    2669370 (-0.11%)
libnum-ebe12db7-0.11.0-pre.so            |     398924   |     399357 (+0.11%) |     395821 (-0.78%)
librand-2ea8f361-0.11.0-pre.rlib         |    1691108   |    1691696 (+0.03%) |    1690264 (-0.05%)
libregex-77385931-0.11.0-pre.rlib        |    2007348   |    2006050 (-0.06%) |    2003804 (-0.18%)
libregex-77385931-0.11.0-pre.so          |     450520   |     450790 (+0.06%) |     449535 (-0.22%)
libregex_macros-a2216dec-0.11.0-pre.so   |     597208   |     569004 (-4.72%) |     568800 (-4.76%)
librlibc-d1ece24e-0.11.0-pre.rlib        |      12394   |      12394 (+0.00%) |      12394 (+0.00%)
librustc-d252d482-0.11.0-pre.so          |   51582383   |   51230320 (-0.68%) |   50930784 (-1.26%)
librustdoc-6ecbf63e-0.11.0-pre.so        |    4557074   |    4501877 (-1.21%) |    4394506 (-3.57%)
librustuv-ede8cb89-0.11.0-pre.rlib       |    4774956   |    4791366 (+0.34%) |    4732386 (-0.89%)
librustuv-ede8cb89-0.11.0-pre.so         |    1401710   |    1400237 (-0.11%) |    1386869 (-1.06%)
libsemver-e49a2dee-0.11.0-pre.rlib       |     392704   |     392434 (-0.07%) |     392940 (+0.06%)
libsemver-e49a2dee-0.11.0-pre.so         |      71863   |      71847 (-0.02%) |      71860 (-0.00%)
libserialize-0352aab7-0.11.0-pre.rlib    |    8059698   |    8033972 (-0.32%) |    7989802 (-0.87%)
libserialize-0352aab7-0.11.0-pre.so      |    1126099   |    1115520 (-0.94%) |    1101721 (-2.16%)
libstd-59beb4f7-0.11.0-pre.rlib          |   18802728   |   18780212 (-0.12%) |   18743438 (-0.32%)
libstd-59beb4f7-0.11.0-pre.so            |    4499534   |    4488835 (-0.24%) |    4477677 (-0.49%)
libsync-305341d2-0.11.0-pre.rlib         |    1377062   |    1400190 (+1.68%) |    1369498 (-0.55%)
libsync-305341d2-0.11.0-pre.so           |     306762   |     312212 (+1.78%) |     304095 (-0.87%)
libsyntax-555559ea-0.11.0-pre.so         |    6703330   |    6632254 (-1.06%) |    6596295 (-1.60%)
libterm-4e4945a5-0.11.0-pre.rlib         |    1503928   |    1512648 (+0.58%) |    1495932 (-0.53%)
libterm-4e4945a5-0.11.0-pre.so           |     389380   |     392678 (+0.85%) |     385517 (-0.99%)
libtest-a79f950d-0.11.0-pre.rlib         |    3606962   |    3555410 (-1.43%) |    3589258 (-0.49%)
libtest-a79f950d-0.11.0-pre.so           |     740255   |     728398 (-1.60%) |     734521 (-0.77%)
libtime-4bb3739b-0.11.0-pre.rlib         |     847036   |     847178 (+0.02%) |     847194 (+0.02%)
libtime-4bb3739b-0.11.0-pre.so           |     131516   |     132829 (+1.00%) |     131518 (+0.00%)
liburl-b8b5640c-0.11.0-pre.rlib          |     647764   |     647558 (-0.03%) |     646896 (-0.13%)
liburl-b8b5640c-0.11.0-pre.so            |     146616   |     146621 (+0.00%) |     146531 (-0.06%)
libuuid-238d8f44-0.11.0-pre.rlib         |     359732   |     359682 (-0.01%) |     358936 (-0.22%)
libuuid-238d8f44-0.11.0-pre.so           |      77110   |      77110 (+0.00%) |      77023 (-0.11%)
total                                    |  237081476   |  236049893 (-0.44%) |  234752639 (-0.98%)

So running MergeFunc early like in the clang patch isn't nearly as good as running it late. I also tried to enable usage of global aliases instead of just thunks when merging functions, but that crashes.

9 years agoauto merge of #16706 : pnkfelix/rust/fsk-fix-nojem-realloc, r=thestinger
bors [Sun, 24 Aug 2014 07:45:59 +0000 (07:45 +0000)]
auto merge of #16706 : pnkfelix/rust/fsk-fix-nojem-realloc, r=thestinger

Copy only up to `min(new_size, old_size)` when doing reallocate.

This was a bug when running with jemalloc disabled.

Fix #16687

9 years agoFix const evaluation of cast expression from bool
Piotr Jawniak [Sat, 23 Aug 2014 11:59:39 +0000 (13:59 +0200)]
Fix const evaluation of cast expression from bool

9 years agoauto merge of #16703 : bluss/rust/assert-bloat, r=huonw
bors [Sun, 24 Aug 2014 06:00:58 +0000 (06:00 +0000)]
auto merge of #16703 : bluss/rust/assert-bloat, r=huonw

With no custom message, we should just use concat! + stringify! for
`assert!(expr)` to avoid the string formatting code path.

Inspired by issue #16625

9 years agoauto merge of #16698 : bluss/rust/slice-bloat, r=huonw
bors [Sun, 24 Aug 2014 03:10:59 +0000 (03:10 +0000)]
auto merge of #16698 : bluss/rust/slice-bloat, r=huonw

These are somewhat stop-gap solutions to address #16625

core: Separate failure formatting in str methods slice, slice_to, slice_from

Use a separate inline-never function to format failure message for
str::slice() errors.

Using strcat's idea, this makes sure no formatting code from failure is
inlined when str::slice() is inlined. The number of `unreachable` being
inlined when usingi `.slice()` drops from 5 to just 1.

The testcase:

```
#![crate_type = "lib"]
pub fn slice(x: &str, a: uint, b: uint) -> &str {
    x.slice(a, b)
}
```

shrinks from 16.9 kB to 3.3 kB llvm IR, and the number of `unreachable` drops from 5 to 1.

9 years agodoc: move misplaced comma
Tshepang Lekhonkhobe [Sun, 24 Aug 2014 02:24:25 +0000 (04:24 +0200)]
doc: move misplaced comma

Also:

* Remove unseeming repetition.
* By now, the reader has already heard that Rust is safe by default, so
reduce the overlong sentence, making it easier to read.

9 years agoauto merge of #16697 : Sawyer47/rust/new-test, r=huonw
bors [Sun, 24 Aug 2014 01:25:57 +0000 (01:25 +0000)]
auto merge of #16697 : Sawyer47/rust/new-test, r=huonw

Closes #10618
Closes #16382

9 years agoEnable the MergeFunc pass
Björn Steinbrink [Sat, 23 Aug 2014 22:03:56 +0000 (00:03 +0200)]
Enable the MergeFunc pass

Fixes #9536

9 years agoauto merge of #16691 : klutzy/rust/issue-15297, r=alexcrichton
bors [Sat, 23 Aug 2014 22:35:56 +0000 (22:35 +0000)]
auto merge of #16691 : klutzy/rust/issue-15297, r=alexcrichton

First commit fixes issue regarding recognizing MSYS2 build.
Second commit fixes issue regarding MSYS/Windows paths.

9 years agoauto merge of #16670 : Swatinem/rust/charascii, r=alexcrichton
bors [Sat, 23 Aug 2014 20:50:57 +0000 (20:50 +0000)]
auto merge of #16670 : Swatinem/rust/charascii, r=alexcrichton

I was doing a lot of parsing ascii strings, and the generic bsearch functions in `tables.rs` came up very high in the profile.
This should avoid calling those functions for simple ASCII range chars.

9 years agoauto merge of #16612 : nham/rust/twoway_searcher_fix, r=alexcrichton
bors [Sat, 23 Aug 2014 18:00:59 +0000 (18:00 +0000)]
auto merge of #16612 : nham/rust/twoway_searcher_fix, r=alexcrichton

There is a check in TwoWaySearcher::new to determine whether the needle is periodic. This is needed because during searching when a match fails, we cannot advance the position by the entire length of the needle when it is periodic, but can only advance by the length of the period.

The reason "bananas".contains("nana") (and similar searches) were returning false was because the periodicity check was wrong.

Closes #16589

Also, thanks to @Gankro, who came up with many buggy examples.

9 years agoCopy only up to `min(new_size, old_size)` when doing reallocate.
Felix S. Klock II [Sat, 23 Aug 2014 15:29:48 +0000 (17:29 +0200)]
Copy only up to `min(new_size, old_size)` when doing reallocate.

Fix #16687

9 years agoTest case to illustate/reproduce bug.
Felix S. Klock II [Sat, 23 Aug 2014 17:22:36 +0000 (19:22 +0200)]
Test case to illustate/reproduce bug.

9 years agoauto merge of #16268 : cakebaker/rust/make_fn_add_three_times_four_public, r=steveklabnik
bors [Sat, 23 Aug 2014 16:15:58 +0000 (16:15 +0000)]
auto merge of #16268 : cakebaker/rust/make_fn_add_three_times_four_public, r=steveklabnik

To avoid a compilation error when running the tests the function has to be public.

9 years agoauto merge of #16693 : vadimcn/rust/rename--win32, r=pcwalton
bors [Sat, 23 Aug 2014 14:30:57 +0000 (14:30 +0000)]
auto merge of #16693 : vadimcn/rust/rename--win32, r=pcwalton

9 years agostd: Use concat! and stringify! to simplify the most common assert! case.
root [Sat, 23 Aug 2014 13:51:07 +0000 (15:51 +0200)]
std: Use concat! and stringify! to simplify the most common assert! case.

With no custom message, we should just use concat! + stringify! for
`assert!(expr)`.

Inspired by issue #16625

9 years agoGuide: Make add_three_times_four() public
Daniel Hofstetter [Tue, 5 Aug 2014 14:43:17 +0000 (16:43 +0200)]
Guide: Make add_three_times_four() public

9 years agocore: Separate failure formatting in str methods slice, slice_to, slice_from
root [Sat, 23 Aug 2014 10:30:08 +0000 (12:30 +0200)]
core: Separate failure formatting in str methods slice, slice_to, slice_from

Use a separate inline-never function to format failure message for
str::slice() errors.

Using strcat's idea, this makes sure no formatting code from failure is
inlined when str::slice() is inlined. The number of `unreachable` being
inlined when usingi `.slice()` drops from 5 to just 1.

9 years agolibunicode: optimize char functions for ascii characters
Arpad Borsos [Fri, 22 Aug 2014 10:04:34 +0000 (12:04 +0200)]
libunicode: optimize char functions for ascii characters

9 years agoAdd test for #10618 and #16382
Piotr Jawniak [Sat, 23 Aug 2014 10:31:48 +0000 (12:31 +0200)]
Add test for #10618 and #16382

Closes #10618
Closes #16382

9 years agoauto merge of #16692 : vadimcn/rust/fix-win64, r=luqmana
bors [Sat, 23 Aug 2014 09:55:52 +0000 (09:55 +0000)]
auto merge of #16692 : vadimcn/rust/fix-win64, r=luqmana

This fixes fallout from 2dc2ac1e6b382b8c658071f61c3f95ae444dcc16, which did not take into account win64.

9 years agoComplete renaming of win32 to windows
Vadim Chugunov [Sat, 23 Aug 2014 08:12:59 +0000 (01:12 -0700)]
Complete renaming of win32 to windows

9 years agoRemove stage0 attributes.
Vadim Chugunov [Sat, 23 Aug 2014 07:59:25 +0000 (00:59 -0700)]
Remove stage0 attributes.

9 years agoFix intptr_t on win64
Vadim Chugunov [Sat, 23 Aug 2014 07:46:36 +0000 (00:46 -0700)]
Fix intptr_t on win64

9 years agoauto merge of #16675 : luqmana/rust/pmu, r=alexcrichton
bors [Sat, 23 Aug 2014 08:10:47 +0000 (08:10 +0000)]
auto merge of #16675 : luqmana/rust/pmu, r=alexcrichton

Fixes #16671.

9 years agoAdd tests.
Luqman Aden [Fri, 22 Aug 2014 17:16:26 +0000 (10:16 -0700)]
Add tests.

9 years agotest: Convert Window path to MSYS path
klutzy [Sat, 23 Aug 2014 06:58:38 +0000 (15:58 +0900)]
test: Convert Window path to MSYS path

When MSYS shell executes program, if its arguments look like MSYS paths,
MSYS automatically converts them into Windows paths.
For example, `/c/path:/d/path` becomes `C:\path;D:\path`.
However, if there is only one path e.g. `/c/path`, it becomes `C:/path`.

maketest.py reverts the behavior to reduce confusion between MSYS and
Windows, but it didn't handle the `/c/path` case. This patch fixes the
issue.

Fixes #15297
Fixes #15250

9 years agoImprove TwoWaySearcher comments.
nham [Wed, 20 Aug 2014 17:57:54 +0000 (13:57 -0400)]
Improve TwoWaySearcher comments.

9 years agoauto merge of #16667 : retep998/rust/master, r=pcwalton
bors [Sat, 23 Aug 2014 01:40:48 +0000 (01:40 +0000)]
auto merge of #16667 : retep998/rust/master, r=pcwalton

9 years agoauto merge of #16663 : Gankro/rust/heapify, r=alexcrichton
bors [Fri, 22 Aug 2014 23:55:50 +0000 (23:55 +0000)]
auto merge of #16663 : Gankro/rust/heapify, r=alexcrichton

Heapify is O(n), extend as currently implemented is O(nlogn). No brainer.

Currently investigating whether extend can just be implemented as a local heapify.

9 years agoauto merge of #16658 : jauhien/rust/fix-llvm, r=thestinger
bors [Fri, 22 Aug 2014 22:10:47 +0000 (22:10 +0000)]
auto merge of #16658 : jauhien/rust/fix-llvm, r=thestinger

Upstream LLVM from VCS already has version 3.6,
configure fixed appropriately to allow building with it

9 years agoauto merge of #16659 : brson/rust/slowparse, r=alexcrichton
bors [Fri, 22 Aug 2014 20:25:49 +0000 (20:25 +0000)]
auto merge of #16659 : brson/rust/slowparse, r=alexcrichton

Note that this contains a 9.5MB test file, but it should compress thoroughly.

9 years agoAdd support for trailing commas in more places
P1start [Thu, 21 Aug 2014 04:37:15 +0000 (16:37 +1200)]
Add support for trailing commas in more places

This lets the parser understand trailing commas in method calls, method
definitions, enum variants, and type parameters.

Closes #14240.
Closes #15887.

9 years agolibrustc: Properly tag upvars in proc's to stop misleading unused_mut warnings.
Luqman Aden [Fri, 22 Aug 2014 17:10:29 +0000 (10:10 -0700)]
librustc: Properly tag upvars in proc's to stop misleading unused_mut warnings.

9 years agoauto merge of #16651 : vks/rust/fix-bitv-bench, r=alexcrichton
bors [Fri, 22 Aug 2014 17:05:48 +0000 (17:05 +0000)]
auto merge of #16651 : vks/rust/fix-bitv-bench, r=alexcrichton

Fixes #12118.

(I sneaked in an unrelated one-character whitespace fix I spotted while reviewing some benchmarks, if that is not okay, I can create a separate pull request for that.)

9 years agoconfigure: Recognize i686 build on msys2
klutzy [Fri, 22 Aug 2014 16:45:15 +0000 (01:45 +0900)]
configure: Recognize i686 build on msys2

9 years agoauto merge of #16656 : luqmana/rust/ucmla, r=pcwalton
bors [Fri, 22 Aug 2014 15:20:48 +0000 (15:20 +0000)]
auto merge of #16656 : luqmana/rust/ucmla, r=pcwalton

Gets rid of a FIXME in `base::get_fn_llvm_attributes`.

r? @pcwalton

9 years agoauto merge of #16655 : pcwalton/rust/unboxed-closures-unboxing-shims, r=luqmana
bors [Fri, 22 Aug 2014 13:35:51 +0000 (13:35 +0000)]
auto merge of #16655 : pcwalton/rust/unboxed-closures-unboxing-shims, r=luqmana

Closes #16591.

r? @luqmana

9 years agoauto merge of #16653 : steveklabnik/rust/module_wording, r=alexcrichton
bors [Fri, 22 Aug 2014 11:50:58 +0000 (11:50 +0000)]
auto merge of #16653 : steveklabnik/rust/module_wording, r=alexcrichton

@kimundi was a bit worried this was misleading.

9 years agoauto merge of #16647 : vhbit/rust/ios-build-fixes, r=alexcrichton
bors [Fri, 22 Aug 2014 09:05:53 +0000 (09:05 +0000)]
auto merge of #16647 : vhbit/rust/ios-build-fixes, r=alexcrichton

9 years agoauto merge of #16639 : pcwalton/rust/unboxed-closures-param-resolution, r=nick29581
bors [Fri, 22 Aug 2014 06:50:56 +0000 (06:50 +0000)]
auto merge of #16639 : pcwalton/rust/unboxed-closures-param-resolution, r=nick29581

Closes #16508.

r? @nick29581

9 years agowin64: Add missing #[repr(C)]
Peter Atashian [Fri, 22 Aug 2014 04:51:16 +0000 (00:51 -0400)]
win64: Add missing #[repr(C)]

Signed-off-by: Peter Atashian <retep998@gmail.com>
9 years agoauto merge of #16616 : pcwalton/rust/unboxed-closure-where-clause, r=nikomatsakis
bors [Fri, 22 Aug 2014 04:25:56 +0000 (04:25 +0000)]
auto merge of #16616 : pcwalton/rust/unboxed-closure-where-clause, r=nikomatsakis

signatures.

Closes #16549.
Closes #16564.

r? @pnkfelix

9 years agoauto merge of #16509 : luqmana/rust/uw, r=alexcrichton
bors [Fri, 22 Aug 2014 02:40:56 +0000 (02:40 +0000)]
auto merge of #16509 : luqmana/rust/uw, r=alexcrichton

Fixes #15401.

9 years agolibrustc: Consider where clauses when traversing free regions in
Patrick Walton [Tue, 19 Aug 2014 21:39:00 +0000 (14:39 -0700)]
librustc: Consider where clauses when traversing free regions in
signatures.

Closes #16549.
Closes #16564.

9 years agoauto merge of #16512 : wickerwaka/rust/getopt-16348, r=brson
bors [Fri, 22 Aug 2014 00:56:00 +0000 (00:56 +0000)]
auto merge of #16512 : wickerwaka/rust/getopt-16348, r=brson

I don't know if anything else was relying on the old behavior, this seems more correct.

Fixes #16348

If '-F' is allowed to have an optional argument, with the previous version '-FF' would be translated to '-F -F'. In this new version '-FF' translates to '-F' with argument 'F'

9 years agomake priorityqueue's from_iter use heapify
Alexis Beingessner [Thu, 21 Aug 2014 23:42:35 +0000 (19:42 -0400)]
make priorityqueue's from_iter use heapify

9 years agoUse only 400000 characters to test slow string parsing.
Brian Anderson [Thu, 21 Aug 2014 23:25:04 +0000 (16:25 -0700)]
Use only 400000 characters to test slow string parsing.

9 years agosyntax: Test parsing of long binary strings
Brian Anderson [Thu, 21 Aug 2014 23:23:02 +0000 (16:23 -0700)]
syntax: Test parsing of long binary strings

9 years agoauto merge of #16637 : pcwalton/rust/unboxed-closures-expected-tuple, r=pnkfelix
bors [Thu, 21 Aug 2014 23:10:59 +0000 (23:10 +0000)]
auto merge of #16637 : pcwalton/rust/unboxed-closures-expected-tuple, r=pnkfelix

code wasn't considering the zero-argument case.

Closes #16168.

r? @pnkfelix

9 years agosyntax: Fix complexity of string parsing. Closes #16624.
Brian Anderson [Thu, 21 Aug 2014 22:47:37 +0000 (15:47 -0700)]
syntax: Fix complexity of string parsing. Closes #16624.

9 years agoFix LLVM version in configure
Jauhien Piatlicki [Thu, 21 Aug 2014 22:39:18 +0000 (00:39 +0200)]
Fix LLVM version in configure

Upstream LLVM from VCS already has version 3.6,
configure fixed appropriately to allow building with it

9 years agoauto merge of #16635 : steveklabnik/rust/ordering_comment, r=huonw
bors [Thu, 21 Aug 2014 21:25:56 +0000 (21:25 +0000)]
auto merge of #16635 : steveklabnik/rust/ordering_comment, r=huonw

This way people won't try to copy/paste it in.

This is provided as an alternate solution to #16003. What do you think, @treeman?

9 years agoauto merge of #16601 : cybergeek94/rust/master, r=alexcrichton
bors [Thu, 21 Aug 2014 19:40:57 +0000 (19:40 +0000)]
auto merge of #16601 : cybergeek94/rust/master, r=alexcrichton

Previously, `PrettyEncoder` indented a magic constant of 2 spaces per level, which may be fine for most uses but in my use case I would like to allow the user to specify the indent step for the outputted JSON in my program.

This is small change that does not break any existing code whatsoever, and does not change the behavior of existing uses. `PrettyEncoder::new()` still uses the default of 2.

I couldn't think of any simple tests for this change. The obvious one would be to check the outputted JSON for the correct number of spaces per indent level, but I think that would be more complex than the actual change itself and test little besides correctness and consistency, which can be verified visually. There's already a test for correct parsing of pretty-printed JSON that should still pass with this change.

9 years agolibrustc: Mark unboxed closure calls and definitions with appropriate llvm return...
Luqman Aden [Thu, 21 Aug 2014 18:25:47 +0000 (11:25 -0700)]
librustc: Mark unboxed closure calls and definitions with appropriate llvm return/argument attributes.

9 years agoParameterize indent in PrettyEncoder
Austin Bonander [Thu, 21 Aug 2014 09:25:24 +0000 (02:25 -0700)]
Parameterize indent in PrettyEncoder

9 years agoauto merge of #16499 : cmr/rust/struct-undef-repr, r=pcwalton
bors [Thu, 21 Aug 2014 17:30:57 +0000 (17:30 +0000)]
auto merge of #16499 : cmr/rust/struct-undef-repr, r=pcwalton

r? @pcwalton

9 years agolibrustc: Create unboxing shims as necessary for unboxed closures.
Patrick Walton [Thu, 21 Aug 2014 17:04:52 +0000 (10:04 -0700)]
librustc: Create unboxing shims as necessary for unboxed closures.

Closes #16591.

9 years agoFix FFI guide
Corey Richardson [Thu, 21 Aug 2014 16:58:42 +0000 (12:58 -0400)]
Fix FFI guide

9 years agofix module wording in guide
Steve Klabnik [Thu, 21 Aug 2014 16:14:59 +0000 (12:14 -0400)]
fix module wording in guide

@kimundi was a bit worried this was misleading.

9 years agoauto merge of #16632 : pcwalton/rust/unboxed-closures-euv, r=luqmana
bors [Thu, 21 Aug 2014 14:40:57 +0000 (14:40 +0000)]
auto merge of #16632 : pcwalton/rust/unboxed-closures-euv, r=luqmana

expression use visitor.

Closes #16166.

r? @huonw

9 years agobitv: make sure benchmarks run long enough
Vinzent Steinberg [Thu, 21 Aug 2014 14:02:55 +0000 (10:02 -0400)]
bitv: make sure benchmarks run long enough

Previously they were too short (less than 10 ns), so the benchmarker
could not resolve them meaningfully. Now they should run in the order of
100 ns.

9 years agoarena: fix a typo
Vinzent Steinberg [Thu, 21 Aug 2014 03:41:02 +0000 (23:41 -0400)]
arena: fix a typo

9 years agobitv: make benchmarks always return a value
Vinzent Steinberg [Thu, 21 Aug 2014 03:36:07 +0000 (23:36 -0400)]
bitv: make benchmarks always return a value

This makes sure that the benchmarked code does not get optimized away.
Also fixed a typo.

Fixes #12118.

9 years agoauto merge of #16631 : pcwalton/rust/unboxed-closures-wrong-trait, r=huonw
bors [Thu, 21 Aug 2014 12:55:54 +0000 (12:55 +0000)]
auto merge of #16631 : pcwalton/rust/unboxed-closures-wrong-trait, r=huonw

the right trait and take the method name into account.

Closes #16599.

r? @huonw

9 years agoauto merge of #16487 : steveklabnik/rust/guide_ownership, r=brson
bors [Thu, 21 Aug 2014 09:55:54 +0000 (09:55 +0000)]
auto merge of #16487 : steveklabnik/rust/guide_ownership, r=brson

Whew. This section was so important, I saved it for last.

/cc @wycats, @nikomatsakis

9 years agoFixed unwinding for iOS
Valerii Hiora [Thu, 21 Aug 2014 08:10:03 +0000 (11:10 +0300)]
Fixed unwinding for iOS

Was broken by Windows adoption

9 years agoiOS compilation fix
Valerii Hiora [Thu, 21 Aug 2014 08:09:23 +0000 (11:09 +0300)]
iOS compilation fix

9 years agoauto merge of #16362 : nham/rust/std_rand_pi_example, r=huonw
bors [Thu, 21 Aug 2014 07:50:55 +0000 (07:50 +0000)]
auto merge of #16362 : nham/rust/std_rand_pi_example, r=huonw

Pros:
I like this example because it's concise without being trivial. The Monty Hall example code is somewhat lengthy and possibly inaccessible to those unfamiliar with probability.

Cons:
The Monty Hall example already exists. Do we need another example? Also, this is probably inaccessible to people who don't know basic geometry.

9 years agoUse unicode pi symbol in pi estimation example. Additional tweaks
nham [Thu, 21 Aug 2014 06:42:15 +0000 (02:42 -0400)]
Use unicode pi symbol in pi estimation example. Additional tweaks

9 years agoSurround formula in a 'notrust' code block
nham [Thu, 21 Aug 2014 06:08:17 +0000 (02:08 -0400)]
Surround formula in a 'notrust' code block

9 years agoauto merge of #16471 : EduardoBautista/rust/chapter-14-fixes, r=steveklabnik
bors [Thu, 21 Aug 2014 06:05:58 +0000 (06:05 +0000)]
auto merge of #16471 : EduardoBautista/rust/chapter-14-fixes, r=steveklabnik

Just some small fixes for the guide.  The cargo stuff is probably because of an update.

9 years agoauto merge of #16447 : steveklabnik/rust/guide_vectors_extra, r=brson
bors [Thu, 21 Aug 2014 04:20:57 +0000 (04:20 +0000)]
auto merge of #16447 : steveklabnik/rust/guide_vectors_extra, r=brson

Can't believe I forgot this!

9 years agoauto merge of #16443 : steveklabnik/rust/fix_path_docs, r=kballard
bors [Thu, 21 Aug 2014 02:36:00 +0000 (02:36 +0000)]
auto merge of #16443 : steveklabnik/rust/fix_path_docs, r=kballard

Originally discovered here: http://www.reddit.com/r/rust/comments/2dbg3j/hm_unwrap_is_being_renamed_to_assert/cjnxiax

9 years agoStage #[repr(packed)] in std::rt
Corey Richardson [Fri, 15 Aug 2014 05:47:28 +0000 (01:47 -0400)]
Stage #[repr(packed)] in std::rt

9 years agolibgreen: use FFI-safe types
Corey Richardson [Thu, 14 Aug 2014 19:49:26 +0000 (15:49 -0400)]
libgreen: use FFI-safe types

9 years agoliblibc: don't use int/uint for intptr_t/uintptr_t
Corey Richardson [Thu, 14 Aug 2014 19:18:14 +0000 (15:18 -0400)]
liblibc: don't use int/uint for intptr_t/uintptr_t

int/uint aren't considered FFI safe, replace them with the actual type they
represent (i64/u64 or i32/u32). This is a breaking change, but at most a cast
to `uint` or `int` needs to be added.

[breaking-change]

9 years agoAdd detailed note about Substs to ty_enum
Corey Richardson [Wed, 9 Jul 2014 13:11:47 +0000 (06:11 -0700)]
Add detailed note about Substs to ty_enum

9 years agomanual: fix link
Corey Richardson [Thu, 29 May 2014 19:41:58 +0000 (12:41 -0700)]
manual: fix link

9 years agoAdd #[repr(C)] to all the things!
Corey Richardson [Wed, 28 May 2014 01:37:49 +0000 (18:37 -0700)]
Add #[repr(C)] to all the things!

9 years agolibrustc: handle repr on structs, require it for ffi, unify with packed
Corey Richardson [Tue, 27 May 2014 06:56:52 +0000 (23:56 -0700)]
librustc: handle repr on structs, require it for ffi, unify with packed

As of RFC 18, struct layout is undefined. Opting into a C-compatible struct
layout is now down with #[repr(C)]. For consistency, specifying a packed
layout is now also down with #[repr(packed)]. Both can be specified.

To fix errors caused by this, just add #[repr(C)] to the structs, and change
 #[packed] to #[repr(packed)]

Closes #14309

[breaking-change]

9 years agoauto merge of #16331 : steveklabnik/rust/guide_macros_and_unsafe, r=brson
bors [Thu, 21 Aug 2014 00:51:00 +0000 (00:51 +0000)]
auto merge of #16331 : steveklabnik/rust/guide_macros_and_unsafe, r=brson

The last two sections of the guide, and a small conclusion. I suck at conclusions.

I also realized I never covered strings, so I'm going to put that section up before we're actually 'done.'

9 years agodocs: don't claim struct layout is specified, but mention repr
Corey Richardson [Mon, 26 May 2014 02:57:17 +0000 (19:57 -0700)]
docs: don't claim struct layout is specified, but mention repr

9 years agoauto merge of #16280 : cburgdorf/rust/patch-3, r=steveklabnik
bors [Wed, 20 Aug 2014 23:06:02 +0000 (23:06 +0000)]
auto merge of #16280 : cburgdorf/rust/patch-3, r=steveklabnik

9 years agoGuide: unsafe
Steve Klabnik [Thu, 7 Aug 2014 22:17:57 +0000 (18:17 -0400)]
Guide: unsafe

9 years agoFix error message for WindowsPath::new
Steve Klabnik [Tue, 12 Aug 2014 10:36:40 +0000 (06:36 -0400)]
Fix error message for WindowsPath::new

Originally discovered here: http://www.reddit.com/r/rust/comments/2dbg3j/hm_unwrap_is_being_renamed_to_assert/cjnxiax