Commit Graph

61593 Commits

Author SHA1 Message Date
Corey Farwell
62d22678d4 Rollup merge of #39630 - alexcrichton:update-manifest, r=brson
Rename manifest_version to manifest-version

The current manifests encode this with a dash in the name, so we should preserve
that!
2017-02-08 10:19:59 -05:00
Corey Farwell
83a581cadb Rollup merge of #39624 - brson:relnotes-master, r=alexcrichton
Bump stable release date

cc https://github.com/rust-lang/rust/pull/39623
2017-02-08 10:19:58 -05:00
Corey Farwell
e15bd3177e Rollup merge of #39622 - alexcrichton:clean-dist, r=brson
rustbuild: Clean build/dist on `make clean`

Prevents stale artifacts from sticking around by accident!
2017-02-08 10:19:57 -05:00
Corey Farwell
722baed173 Rollup merge of #39597 - GuillaumeGomez:correct_rustdoc_test_file, r=alexcrichton
Display correct filename with --test option

Fixes #39592.

With the current files:

```rust
pub mod foo;

/// This is a Foo;
///
/// ```
/// println!("baaaaaar");
/// ```
pub struct Foo;

/// This is a Bar;
///
/// ```
/// println!("fooooo");
/// ```
pub struct Bar;
```

```rust
// note the whitespaces
/// ```
/// println!("foo");
/// ```
pub fn foo() {}
```

It displays:

```
./build/x86_64-apple-darwin/stage1/bin/rustdoc --test test.rs

running 3 tests
test test.rs - line 13 ... ok
test test.rs - line 5 ... ok
test foo.rs - line 2 ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured
```

```

` ``
println!("lol");
` ``

asdjnfasd

asd
```

It displays:

```
./build/x86_64-apple-darwin/stage1/bin/rustdoc --test foo.md

running 1 test
test <input> - line 3 ... ok

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

r? @alexcrichton
2017-02-08 10:19:55 -05:00
Corey Farwell
7658921267 Rollup merge of #39583 - michaelwoerister:limit-llvm-threads, r=nikomatsakis
back: Limit the number of LLVM worker threads.

This should fix issue https://github.com/rust-lang/rust/issues/39568.
Also see https://github.com/rust-lang/rust/issues/39280.

r? @nikomatsakis
2017-02-08 10:19:54 -05:00
Corey Farwell
944933ef4e Rollup merge of #39582 - nikomatsakis:incr-comp-issue-39569, r=michaelwoerister
Handle the case where an intermediate node can't be recreated

This solution grows the graph, but this is quite the corner case.

r? @michaelwoerister
2017-02-08 10:19:52 -05:00
Corey Farwell
e0eeb6e637 Rollup merge of #39561 - phungleson:libcollectionsbench, r=alexcrichton
Extract collections benchmarks to libcollections/bench

Good suggestion from @stjepang https://github.com/rust-lang/rust/issues/39484#issuecomment-277467765

r? @alexcrichton
2017-02-08 10:19:51 -05:00
Corey Farwell
75f97db367 Rollup merge of #39557 - bjorn3:pp-docs, r=jseyfried
A few documentation improvements for `syntax::print::pp`

* Moved algorithm explanation to module docs
* Added ``` before and after the examples
* Explanation of the `rbox`, `ibox` and `cbox` names
* Added docs about the breaking types to `Breaks`
2017-02-08 10:19:50 -05:00
Corey Farwell
7709c4d2b9 Rollup merge of #39529 - dylanmckay:llvm-4.0-align32, r=alexcrichton
[LLVM 4.0] Use 32-bits for alignment

LLVM 4.0 changes this. This change is fine to make for LLVM 3.9 as we
won't have alignments greater than 2^32-1.
2017-02-08 10:19:49 -05:00
Corey Farwell
96bf9ba94d Rollup merge of #39512 - oconnor663:try_wait, r=alexcrichton
make Child::try_wait return io::Result<Option<ExitStatus>>

This is much nicer for callers who want to short-circuit real I/O errors
with `?`, because they can write this

    if let Some(status) = foo.try_wait()? {
        ...
    } else {
        ...
    }

instead of this

    match foo.try_wait() {
        Ok(status) => {
            ...
        }
        Err(err) if err.kind() == io::ErrorKind::WouldBlock => {
            ...
        }
        Err(err) => return Err(err),
    }

The original design of `try_wait` was patterned after the `Read` and
`Write` traits, which support both blocking and non-blocking
implementations in a single API. But since `try_wait` is never blocking,
it makes sense to optimize for the non-blocking case.

Tracking issue: https://github.com/rust-lang/rust/issues/38903
2017-02-08 10:19:48 -05:00
Corey Farwell
f69259ecf8 Rollup merge of #39462 - emilio:improper-ctypes, r=nikomatsakis
lint/ctypes: Don't warn on sized structs with PhantomData.

Fixes #34798
2017-02-08 10:19:47 -05:00
Stjepan Glavina
ececbb2687 Simplify by calling SliceOrd::compare 2017-02-08 16:01:32 +01:00
f001
d90a7b3b00 std: Add retain method for HashMap and HashSet
Fix #36648
2017-02-08 21:43:24 +08:00
est31
f8b6108deb Stabilize static in const
Closes #35897.
2017-02-08 12:33:35 +01:00
Stjepan Glavina
3bd6e46687 Specialize PartialOrd<A> for [A] where A: Ord
This way we can call `cmp` instead of `partial_cmp` in the loop,
removing some burden of optimizing `Option`s away from the compiler.

PR #39538 introduced a regression where sorting slices suddenly became
slower, since `slice1.lt(slice2)` was much slower than
`slice1.cmp(slice2) == Less`. This problem is now fixed.

To verify, I benchmarked this simple program:
```rust
fn main() {
    let mut v = (0..2_000_000).map(|x| x * x * x * 18913515181).map(|x| vec![x, x ^ 3137831591]).collect::<Vec<_>>();
    v.sort();
}
```

Before this PR, it would take 0.95 sec, and now it takes 0.58 sec.
I also tried changing the `is_less` lambda to use `cmp` and
`partial_cmp`. Now all three versions (`lt`, `cmp`, `partial_cmp`) are
equally performant for sorting slices - all of them take 0.58 sec on the
benchmark.
2017-02-08 12:19:50 +01:00
Ms2ger
52a887e12b Remove some leftover makefiles. 2017-02-08 10:56:42 +01:00
Guillaume Gomez
d2f8abf254 Add more test for rustdoc --test 2017-02-08 10:10:06 +01:00
bors
10f6a5c443 Auto merge of #39638 - frewsxcv:rollup, r=frewsxcv
Rollup of 13 pull requests

- Successful merges: #38764, #39361, #39372, #39374, #39400, #39426, #39431, #39459, #39482, #39545, #39593, #39620, #39621
- Failed merges:
2017-02-08 03:55:13 +00:00
Corey Farwell
0a815ac816 Rollup merge of #39621 - GuillaumeGomez:current_dir_docs, r=steveklabnik
Add missing urls for current_dir

r? @steveklabnik
2017-02-07 22:54:32 -05:00
Corey Farwell
68872a8a90 Rollup merge of #39620 - Gheoan:patch-1, r=steveklabnik
add missing comma
2017-02-07 22:54:30 -05:00
Corey Farwell
83595fa2f4 Rollup merge of #39593 - steveklabnik:bookshelf-landing-page, r=frewsxcv
Re-write the doc index page

Clarify and reorganize.

Add the section for the bookshelf. More to come here in the near future!

Part of #39588
2017-02-07 22:54:29 -05:00
Corey Farwell
1531071a8a Rollup merge of #39545 - JordiPolo:fix/1_15_released, r=jseyfried
Change deprecation warning to indicate custom derive support was removed

I'm very new to Rust and the message was confusing to me (using nightly and not really sure if I was > 1.15 or not).
2017-02-07 22:54:28 -05:00
Corey Farwell
4c5b868cc3 Rollup merge of #39482 - king6cong:master, r=frewsxcv
doc comment rewording
2017-02-07 22:54:27 -05:00
Corey Farwell
d1f8c448ff Rollup merge of #39459 - phungleson:fix-short-hand-struct-doc, r=steveklabnik
Fix short hand struct doc

Don't want to discredit @hngiang effort on this issue.

I just want to lend a hand to fix this issue #38830, it is a very nice feature and is seemingly completed.

Fixes #39096

r? @steveklabnik
2017-02-07 22:54:26 -05:00
Corey Farwell
6fb57bf13f Rollup merge of #39431 - alexcrichton:no-more-makefiles, r=brson
Delete the makefile build system

This PR deletes the makefile build system in favor of the rustbuild build system. The beta has now been branched so 1.16 will continue to be buildable from the makefiles, but going forward 1.17 will only be buildable with rustbuild.

Rustbuild has been the default build system [since 1.15.0](https://github.com/rust-lang/rust/pull/37817) and the makefiles were [proposed for deletion](https://internals.rust-lang.org/t/proposal-for-promoting-rustbuild-to-official-status/4368) at this time back in November of last year.

And now with the deletion of these makefiles we can start getting those sweet sweet improvements of using crates.io crates in the compiler!
2017-02-07 22:54:25 -05:00
Corey Farwell
3d8fa5af21 Rollup merge of #39426 - jakllsch:netbsd-c, r=alexcrichton
Add i686-unknown-netbsdelf target
2017-02-07 22:54:24 -05:00
Corey Farwell
370b63f386 Rollup merge of #39400 - alexcrichton:arm-cross-test, r=brson
Add support for test suites emulated in QEMU

This commit adds support to the build system to execute test suites that cannot
run natively but can instead run inside of a QEMU emulator. A proof-of-concept
builder was added for the `arm-unknown-linux-gnueabihf` target to show off how
this might work.

In general the architecture is to have a server running inside of the emulator
which a local client connects to. The protocol between the server/client
supports compiling tests on the host and running them on the target inside the
emulator.

Closes #33114
2017-02-07 22:54:23 -05:00
Corey Farwell
4c29a19bd5 Rollup merge of #39374 - durka:patch-34, r=steveklabnik
reference: clarify #[cfg] section

Closes #39370, but maybe we (or clippy) should add a warning too.
2017-02-07 22:54:22 -05:00
Corey Farwell
1d67bb9a0c Rollup merge of #39372 - seanmonstar:more-addr-froms, r=alexcrichton
A few ergonomic From impls for SocketAddr/IpAddr

My main motivation is removing things like this: `"127.0.0.1:3000".parse().unwrap()`. Instead, this now works: `SocketAddr::from(([127, 0, 0, 1], 3000))` or even `([127, 0, 0, 1], 3000).into())` when passing to a function.
2017-02-07 22:54:21 -05:00
Corey Farwell
19977911ce Rollup merge of #39361 - cengizIO:master, r=arielb1
Improve error message for uninferrable types #38812

Hello,

I tried to improve the error message for uninferrable types. The error code is `E0282`.

```rust

error[E0282]: type annotations needed
 --> /home/cengizIO/issue38812.rs:2:11
  |
2 |   let x = vec![];
  |       -   ^^^^^^ cannot infer type for `T`
  |       |
  |       consider giving `x` a type
  |
  = note: this error originates in a macro outside of the current crate
```

and

```rust

error[E0282]: type annotations needed
 --> /home/cengizIO/issue38812.rs:2:15
  |
2 |   let (x,) = (vec![],);
  |       ----    ^^^^^^ cannot infer type for `T`
  |       |
  |       consider giving a type to pattern
  |
  = note: this error originates in a macro outside of the current crate
```

Rust compiler now tries to find uninferred `local`s with type `_` and adds them into the error message.

I'm probably wrong on wording that I used. Please feel free to suggest better alternatives.

Thanks @nikomatsakis for mentoring 🍺

Any comments/feedback is more than welcome!

Thank you
2017-02-07 22:54:20 -05:00
Corey Farwell
4cde461bb0 Rollup merge of #38764 - Aaronepower:master, r=aturon
Added Default impl to PathBuf
2017-02-07 22:54:19 -05:00
Alex Crichton
e53eaa385e Rename manifest_version to manifest-version
The current manifests encode this with a dash in the name, so we should preserve
that!
2017-02-07 16:20:41 -08:00
bors
c14f87e3b0 Auto merge of #39324 - clarcharr:ipv6_u128, r=alexcrichton
Ipv6Addr <-> u128

Because we have `u128` now, it makes sense to add a conversion between `Ipv6Addr` and `u128` in addition to the existing one between `Ipv4Addr` and `u32`.

This shouldn't violate the existing feature gate on `u128` because you can't use the type without the feature gate, but if i have to add something, I can.
2017-02-08 00:03:42 +00:00
Alex Burka
620074df6a reference: clarify #[cfg] section 2017-02-07 15:35:54 -05:00
Brian Anderson
7916e00f2b Bump stable release date 2017-02-07 19:48:16 +00:00
Alex Crichton
37887fce11 rustbuild: Clean build/dist on make clean
Prevents stale artifacts from sticking around by accident!
2017-02-07 11:39:42 -08:00
Guillaume Gomez
d0378089de Add missing urls for current_dir 2017-02-07 19:43:22 +01:00
Steve Klabnik
78dd2ec2c2 review nits 2017-02-07 13:04:57 -05:00
Gheorghe Anghelescu
ffea076f1b add missing comma 2017-02-07 19:47:48 +02:00
Austin Hicks
c3b64cf702 Refactor layout to use the new ReprOptions 2017-02-07 12:35:06 -05:00
bors
a797b6e2fe Auto merge of #39002 - GuillaumeGomez:debug_libcollections, r=aturon
Add Debug implementations for libcollection structs

Part of #31869.
2017-02-07 17:28:51 +00:00
Michael Woerister
e5396e025e Choose different name for metadata obj-file to avoid clashes with user-chosen names. 2017-02-07 12:24:43 -05:00
Son
2ba0b65c27 Improve fmt float
* Move to a separate float mod
* Add more tests for f64 f32 lower exp upper exp
* Use assert_eq for a clearer error message
2017-02-07 20:58:34 +11:00
Jordi Polo
b74e668ded Change deprecation warning to indicate custom derive support was removed from the current compiler version 2017-02-07 18:17:06 +09:00
Zack M. Davis
65435e14fe improve error message when two-arg assert_eq! receives a trailing comma
Previously, `assert_eq!(left, right,)` (respectively, `assert_ne!(left,
right,)`; note the trailing comma) would result in a confusing "requires
at least a format string argument" error. In reality, a format string is
optional, but the trailing comma puts us into the "match a token tree of
zero or more tokens" branch of the macro (in order to support the
optional format string), and passing the empty token tree into
`format_args!` results in the confusing error. If instead we match a
token tree of one or more tokens, we get a much more sensible
"unexpected end of macro invocation" error.

While we're here, fix up a stray space before a comma in the match
guards.

Resolves #39369.
2017-02-06 22:33:09 -08:00
Jack O'Connor
2a345bbcc1 make Child::try_wait return io::Result<Option<ExitStatus>>
This is much nicer for callers who want to short-circuit real I/O errors
with `?`, because they can write this

    if let Some(status) = foo.try_wait()? {
        ...
    } else {
        ...
    }

instead of this

    match foo.try_wait() {
        Ok(status) => {
            ...
        }
        Err(err) if err.kind() == io::ErrorKind::WouldBlock => {
            ...
        }
        Err(err) => return Err(err),
    }

The original design of `try_wait` was patterned after the `Read` and
`Write` traits, which support both blocking and non-blocking
implementations in a single API. But since `try_wait` is never blocking,
it makes sense to optimize for the non-blocking case.

Tracking issue: https://github.com/rust-lang/rust/issues/38903
2017-02-06 23:04:47 -05:00
Austin Hicks
541aa8a270 Introduce ReprOptions, a struct for holding info from the repr attributes. This effectively deprecates lookup_repr_hints. 2017-02-06 21:13:50 -05:00
Esteban Küber
df73bc9c9d Fix ICE when accessing mutably an immutable enum 2017-02-06 16:59:23 -08:00
est31
ddb0a7855c Unignore u128 test for stage 0,1
Even more SNAP cleanup.
2017-02-07 01:55:17 +01:00
bors
c49d10207a Auto merge of #39591 - alexcrichton:revert-128, r=brson
Revert "Add 128-bit atomics"

This reverts commit 9903975003.

Unfortunately 128-bit atomics have broken our nightly builds (#39590) and while we investigate I'm posting a temporary revert of the PR that added them. If we can figure out a solution though before this lands I'd be happy to close!
2017-02-07 00:22:19 +00:00