Commit Graph

42021 Commits

Author SHA1 Message Date
bors
f49a98431b Auto merge of #25103 - alexcrichton:issue-25072, r=brson
This was one last spot where directories were being leaked through with
arguments of the form `\\?\` which neither `ld.exe` nor `gcc.exe` does
understands so the prefix needed to be stripped.

Closes #25072
2015-05-04 20:48:49 +00:00
Alex Crichton
e6c23bb893 rustc_trans: Fix another windows verbatim path
This was one last spot where directories were being leaked through with
arguments of the form `\\?\` which neither `ld.exe` nor `gcc.exe` does
understands so the prefix needed to be stripped.

Closes #25072
2015-05-04 13:18:00 -07:00
bors
9b481f89d1 Auto merge of #25056 - jooert:sometests, r=alexcrichton
Add several regression tests and remove some unnecessary FIXMEs.
2015-05-04 18:59:47 +00:00
Johannes Oertel
e7d052ebd9 Remove several FIXMEs 2015-05-04 20:05:40 +02:00
bors
70db76602e Auto merge of #25078 - nham:std_net_impl_debug, r=alexcrichton
I'm uncertain whether the 3 implementations in `net2` should unwrap the socket address values. Without unwrapping it looks like this:

```
UdpSocket { addr: Ok(V4(127.0.0.1:34354)), inner: 3 }
TcpListener { addr: Ok(V4(127.0.0.1:9123)), inner: 4 }
TcpStream { addr: Ok(V4(127.0.0.1:9123)), peer: Ok(V4(127.0.0.1:58360)), inner: 5 }
```

One issue is that you can create, e.g. `UdpSocket`s with bad addresses, which means you can't just unwrap in the implementation:

```
#![feature(from_raw_os)]
use std::net::UdpSocket;
use std::os::unix::io::FromRawFd;

let sock: UdpSocket = unsafe { FromRawFd::from_raw_fd(-1) };
println!("{:?}", sock); // prints "UdpSocket { addr: Err(Error { repr: Os(9) }), inner: -1 }"

```

Fixes #23134.
2015-05-04 17:12:19 +00:00
bors
a979efc2f9 Auto merge of #25082 - shepmaster:inline-docs, r=steveklabnik 2015-05-04 13:16:20 +00:00
bors
165a8dec9c Auto merge of #25055 - bguiz:patch-2, r=steveklabnik
- I found n error in the book, before contributing the patch to fix it, I had to find where they were hosted
- It took me quite look to find where within the rust-lang *organisation* it was! ... and this should make it easier for the next person in the same position
2015-05-04 09:11:27 +00:00
bors
1ea9e8db6f Auto merge of #25067 - koute:master, r=alexcrichton
Without the inline annotation this:
    str::from_utf8_unchecked( slice::from_raw_parts( ptr, len ) )
doesn't get inlined which can be pretty brutal performance-wise
when used in an inner loop of a low level string manipulation method.
2015-05-04 07:24:24 +00:00
bors
6517a0e90e Auto merge of #25047 - sinkuu:vec_intoiter_override, r=alexcrichton
Override methods `count`, `last`, and `nth` in vec::IntoIter.

#24214
2015-05-04 04:05:37 +00:00
bors
45b9a34a7b Auto merge of #25044 - tshepang:doc-addr, r=alexcrichton 2015-05-04 02:19:09 +00:00
Nick Hamann
987eb28eca Add tests for 3 Debug implementations 2015-05-03 20:01:25 -05:00
bors
ce1150b9f0 Auto merge of #25043 - alexcrichton:musl-out-of-stack, r=nikomatsakis
Stack overflow detection does not currently work with MUSL, so this test needs
to be disabled.
2015-05-04 00:31:09 +00:00
bors
77ce30f038 Auto merge of #24990 - steveklabnik:doc_associated_constants, r=alexcrichton 2015-05-03 22:42:33 +00:00
Nick Hamann
91f9dd468f Change 'inner' field name to 'fd'/'socket' on Unix/Windows in Debug impls 2015-05-03 17:31:26 -05:00
Nick Hamann
dd85c42ee1 Unwrap address values in Debug implementations for TcpStream/TcpListener/UdpSocket.
This now omits address fields in Debug implementations when a proper address value
cannot be unwrapped.
2015-05-03 17:13:42 -05:00
Jake Goulding
7826711dcb Clean up the grammar around the inline attribute 2015-05-03 17:52:11 -04:00
bors
796be61e90 Auto merge of #25070 - dotdash:inline_hash, r=alexcrichton
Since the hashmap and its hasher are implemented in different crates, we
currently can't benefit from inlining, which means that especially for
small, fixed size keys, there is a huge overhead in hash calculations,
because the compiler can't apply optimizations that only apply for these
keys.

Fixes the brainfuck benchmark in #24014.
2015-05-03 20:55:59 +00:00
bors
6b3d66b04f Auto merge of #25060 - luqmana:matching-dst-struct, r=huonw
Fixes #23261.

cc @blaenk
2015-05-03 19:08:06 +00:00
Nick Hamann
3a4a1e5f38 Implement Debug for std::net::{UdpSocket,TcpStream,TcpListener,Shutdown}
Fixes #23134.
2015-05-03 14:02:59 -05:00
bors
1a60dc4fc4 Auto merge of #24737 - P1start:dst-cell, r=alexcrichton
This + DST coercions (#24619) would allow code like `Rc<RefCell<Box<Trait>>>` to be simplified to `Rc<RefCell<Trait>>`.
2015-05-03 17:22:09 +00:00
bors
26933a638c Auto merge of #25048 - huonw:test-benches, r=alexcrichton
E.g. if `foo.rs` looks like

    #![feature(test)]
    extern crate test;

    #[bench]
    fn bar(b: &mut test::Bencher) {
        b.iter(|| {
            1
        })
    }

    #[test]
    fn baz() {}

    #[bench]
    fn qux(b: &mut test::Bencher) {
        b.iter(|| {
            panic!()
        })
    }

Then

    $ rustc --test foo.rs
    $ ./foo

    running 3 tests
    test baz ... ok
    test qux ... FAILED
    test bar ... ok

    failures:

    ---- qux stdout ----
    	thread 'qux' panicked at 'explicit panic', bench.rs:17

    failures:
        qux

    test result: FAILED. 2 passed; 1 failed; 0 ignored; 0 measured

    $ ./foo --bench ba

    running 2 tests
    test baz ... ignored
    test bar ... bench:        97 ns/iter (+/- 74)

    test result: ok. 0 passed; 0 failed; 1 ignored; 1 measured

In particular, the two benchmark are being run as tests in the default
mode.

This helps for the main distribution, since benchmarks are only run with
`PLEASE_BENCH=1`, which is rarely set (and never set on the test bots),
and helps for code-coverage tools: benchmarks are run and so don't count
as dead code.

Fixes #15842.
2015-05-03 14:06:08 +00:00
Björn Steinbrink
f4176b52d3 Restore HashMap performance by allowing some functions to be inlined
Since the hashmap and its hasher are implemented in different crates, we
currently can't benefit from inlining, which means that especially for
small, fixed size keys, there is a huge overhead in hash calculations,
because the compiler can't apply optimizations that only apply for these
keys.

Fixes the brainfuck benchmark in #24014.
2015-05-03 14:08:30 +02:00
Jan Bujak
91ea0c4f12 Add #[inline(always)] to str::from_utf8_unchecked
Without the inline annotation this:
    str::from_utf8_unchecked( slice::from_raw_parts( ptr, len ) )
doesn't get inlined which can be pretty brutal performance-wise
when used in an inner loop of a low level string manipulation method.
2015-05-03 12:09:40 +02:00
Luqman Aden
715605faf9 librustc_trans: Handle DST structs in trans::_match. 2015-05-03 05:36:04 -04:00
bors
07915ef6a1 Auto merge of #25064 - tshepang:brevity, r=alexcrichton 2015-05-03 07:08:13 +00:00
Tshepang Lekhonkhobe
78c1ae2791 doc: make concat() and connect() examples brief 2015-05-03 05:27:36 +02:00
Tshepang Lekhonkhobe
f86da3d6de doc: improve IpAddr is_global and is_unicast_global 2015-05-03 04:57:02 +02:00
bors
0d7d3ec9d2 Auto merge of #25058 - steveklabnik:gh25008, r=huonw
Fixes #25008
2015-05-02 20:47:32 +00:00
bors
5574029b68 Auto merge of #25038 - bluss:fat-pointer-cast, r=luqmana
typeck: Make sure casts from other types to fat pointers are illegal

Fixes ICEs where non-fat pointers and scalars are cast to fat pointers,

Fixes #21397
Fixes #22955
Fixes #23237
Fixes #24100
2015-05-02 17:44:11 +00:00
Steve Klabnik
6b465f5c87 TRPL: associated constants 2015-05-02 11:58:30 -04:00
Steve Klabnik
df18642b1a Revise @ in patterns section
Fixes #25008
2015-05-02 11:56:58 -04:00
bors
84f8c257b4 Auto merge of #25054 - bguiz:patch-1, r=steveklabnik
- `0..2` iterates over `0,1`
- `0..3` iterates over `0,1,2`, which is what we want instead
2015-05-02 14:42:57 +00:00
Johannes Oertel
42123b75f9 Add regression test for #19380
Closes #19380.
2015-05-02 15:22:27 +02:00
Johannes Oertel
2193857251 Add regression test for #19163
Closes #19163.
2015-05-02 15:22:27 +02:00
Johannes Oertel
c81d8f940a Add regression test for #19109
Closes #19109.
2015-05-02 15:22:27 +02:00
Johannes Oertel
2cf47917ab Add regression test for #18943
Closes #18943.
2015-05-02 15:22:27 +02:00
Johannes Oertel
2595b1e282 Add regression test for #17959
Closes #17959.
2015-05-02 15:22:27 +02:00
Johannes Oertel
3878f4d519 Add regression test for #17170
Closes #17170.
2015-05-02 15:22:27 +02:00
Johannes Oertel
846b36833e Add regression test for #12511
Closes #12511.
2015-05-02 15:22:26 +02:00
Johannes Oertel
d0e594862c Add regression test for #14565
Closes #14565.
2015-05-02 15:22:26 +02:00
bors
38cedaf430 Auto merge of #25045 - XuefengWu:1398_remove_ndebug, r=huonw
According to #1398 and pull https://github.com/rust-lang/cargo/pull/1444 , fix doc overridable using -C debug-assertions
2015-05-02 12:56:05 +00:00
Brendan Graetz
3eee2b9319 =BG= minor: add link to book source files
- I found n error in the book, before contributing the patch to fix it, I had to find where they were hosted
- It took me quite look to find where within the rust-lang *organisation* it was!
2015-05-02 22:40:07 +10:00
Brendan Graetz
07ff8279be =BG= minor: ensure correct range bounds in concurreny examples in the rust book
- `0..2` iterates over `0,1`
- `0..3` iterates over `0,1,2`, which is what we want instead
2015-05-02 22:29:53 +10:00
bors
354d16bd72 Auto merge of #25027 - Manishearth:deriving_attr, r=huonw
Adds an `attrs` field to `FieldInfo` which lets one check the attributes on
a field whilst expanding.

This lets deriving plugins be more robust, for example providing the ability to
"ignore" a field for the purpose of deriving, or perhaps handle the field a
different way.


r? @huonw
2015-05-02 09:55:13 +00:00
Manish Goregaokar
5892b40859 Rename AstBuilder::expr_int -> AstBuilder::expr_isize 2015-05-02 13:57:58 +05:30
bors
82158c9d1c Auto merge of #25040 - mrsweaters:patch-1, r=alexcrichton
Correct 'danging' to 'dangling'.
2015-05-02 08:09:47 +00:00
sinkuu
5d8431c203 Override Iterator::count method in vec::IntoIter 2015-05-02 17:05:43 +09:00
bors
f0af2ec99c Auto merge of #24980 - jooert:test-22468, r=pnkfelix
Closes #22468.
2015-05-02 06:22:41 +00:00
Huon Wilson
d73545ceca Run benchmarks once, as a test by default.
E.g. if `foo.rs` looks like

    #![feature(test)]
    extern crate test;

    #[bench]
    fn bar(b: &mut test::Bencher) {
        b.iter(|| {
            1
        })
    }

    #[test]
    fn baz() {}

    #[bench]
    fn qux(b: &mut test::Bencher) {
        b.iter(|| {
            panic!()
        })
    }

Then

    $ rustc --test foo.rs
    $ ./foo

    running 3 tests
    test baz ... ok
    test qux ... FAILED
    test bar ... ok

    failures:

    ---- qux stdout ----
    	thread 'qux' panicked at 'explicit panic', bench.rs:17

    failures:
        qux

    test result: FAILED. 2 passed; 1 failed; 0 ignored; 0 measured

    $ ./foo --bench ba

    running 2 tests
    test baz ... ignored
    test bar ... bench:        97 ns/iter (+/- 74)

    test result: ok. 0 passed; 0 failed; 1 ignored; 1 measured

In particular, the two benchmark are being run as tests in the default
mode.

This helps for the main distribution, since benchmarks are only run with
`PLEASE_BENCH=1`, which is rarely set (and never set on the test bots),
and helps for code-coverage tools: benchmarks are run and so don't count
as dead code.

Fixes #15842.
2015-05-02 15:45:23 +10:00
bors
700b4c160b Auto merge of #25028 - bluss:drain-string, r=alexcrichton
collections: Implement String::drain(range) according to RFC 574

`.drain(range)` is unstable and under feature(collections_drain).

This adds a safe way to remove any range of a String as efficiently as
possible.

As noted in the code, this drain iterator has none of the memory safety
issues of the vector version.

RFC tracking issue is #23055
2015-05-02 04:35:33 +00:00