Commit Graph

61751 Commits

Author SHA1 Message Date
Eduard-Mihai Burtescu
f1350408c9 Rollup merge of #40026 - nrc:analysis-manifest, r=alexcrichton
Add save-analysis data to nightly manifests.

For use by RLS.

r? @alexcrichton
2017-02-25 14:13:34 +02:00
Eduard-Mihai Burtescu
c3075f3d96 Rollup merge of #40025 - est31:master, r=eddyb
Implement non-capturing closure to fn coercion

Implements non capturing closure coercion ([RFC 1558](https://github.com/rust-lang/rfcs/blob/master/text/1558-closure-to-fn-coercion.md)).

cc tracking issue #39817
2017-02-25 14:13:33 +02:00
Eduard-Mihai Burtescu
32af4ceb04 Rollup merge of #40024 - raphlinus:readdir, r=alexcrichton
Switch Fuchsia to readdir (instead of readdir_r)

The readdir_r function is deprecated on newer Posix systems because of
various problems, and not implemented at all for Fuchsia. There are
already implementations using both, and this patch switches Fuchsia
over to the readdir-based one.

Fixes #40021 for Fuchsia, but that issue also contains discussion of
what should happen for other Posix systems.
2017-02-25 14:13:32 +02:00
Eduard-Mihai Burtescu
ebde617c7d Rollup merge of #40022 - wagenet:lib-defaults, r=alexcrichton
Better handling of lib defaults

r? @alexcrichton
2017-02-25 14:13:31 +02:00
Eduard-Mihai Burtescu
3ece892490 Rollup merge of #40020 - alexcrichton:fix-unwind-safe, r=sfackler
std: Relax UnwindSafe impl for Unique

Add the `?Sized` bound as we don't require the type to be sized.

Closes #40011
2017-02-25 14:13:31 +02:00
Eduard-Mihai Burtescu
411d8e95db Rollup merge of #40019 - alexcrichton:fix-musl, r=brson
travis: Compile a more compatible libc.a for musl

The mitigations for #34978 involve passing `-Wa,-mrelax-relocations=no` to all C
code we compile, and we just forgot to pass it when compiling musl itself.

Closes #39979
2017-02-25 14:13:30 +02:00
Eduard-Mihai Burtescu
5c0b4b3691 Rollup merge of #39995 - Aatch:vtable-ptr-metadata, r=arielb1
Set metadata for vtable-related loads

Give LLVM much more information about vtable pointers. Without the extra
information, LLVM has to be rather pessimistic about vtables, preventing
a number of obvious optimisations.

* Makes the vtable pointer argument noalias and readonly.
* Marks loads of the vtable pointer as nonnull.
* Marks load from the vtable with `!invariant.load` metadata.

Fixes #39992
2017-02-25 14:13:28 +02:00
Eduard-Mihai Burtescu
0a950bdb3d Rollup merge of #39993 - japaric:incr-san, r=alexcrichton
incr-comp: track the -Z sanitizer flag

closes #39611

r? @michaelwoerister
2017-02-25 14:13:27 +02:00
Eduard-Mihai Burtescu
d78a7fcea4 Rollup merge of #39988 - arthurprs:hm-adapt2, r=alexcrichton
Simplify/fix adaptive hashmap

Please see https://github.com/rust-lang/rust/pull/38368#issuecomment-280957863 for context.

The shift length math is broken. It turns out that checking for the shift length is complicated. Using simulations it's possible to see that a value of 2000 will only get probabilities down to ~1e-7 when the hashmap load factor is 90% (rust goes up to 90.9% as of today). That's probably not good enough to go into the stdlib with pluggable hashers.

So this PR simplify the adaptive behavior to only consider displacement, which is much safer and very useful by itself.

There's two comments because one of them is already being tested to be merged by bors.
2017-02-25 14:13:26 +02:00
Eduard-Mihai Burtescu
33c19129c3 Rollup merge of #39980 - arielb1:privately-uninhabited, r=nikomatsakis
check_match: don't treat privately uninhabited types as uninhabited

Fixes #38972, which is a regression in 1.16 from @canndrew's patchset.

r? @nikomatsakis

beta-nominating because regression.
2017-02-25 14:13:25 +02:00
Eduard-Mihai Burtescu
ef043a7c43 Rollup merge of #39961 - redox-os:redox, r=alexcrichton
Fix compilation on Redox

This updates the Redox sys module to fix compilation.

The functions peek and peek_from are added to TcpStream and UdpSocket as stubs. The sys::backtrace module is now included correctly
2017-02-25 14:13:24 +02:00
Eduard-Mihai Burtescu
a6a5c32e0e Rollup merge of #39953 - keeperofdakeys:macro-error, r=jseyfried
Provide suggestions for unknown macros imported with `use`

cc https://github.com/rust-lang/rust/issues/30197

r? @jseyfried
2017-02-25 14:13:23 +02:00
Eduard-Mihai Burtescu
be66a607da Rollup merge of #39950 - ishitatsuyuki:stop-trashing-ldpath, r=alexcrichton
bootstrap: stop trashing (DY)LD_LIBRARY_PATH

This generated an ugly error with fakeroot before.
2017-02-25 14:13:22 +02:00
Eduard-Mihai Burtescu
16202862b2 Rollup merge of #39945 - petrochenkov:llvmtarg, r=alexcrichton
Use ARM instead of SystemZ for testing uninstalled targets

This needs some explanation.
`config.toml` has section `targets` listing backends that are built during LLVM build:
```
targets = "X86;ARM;AArch64;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX"
```
It would be reasonable to expect that `targets = "X86"` would be enough for doing a local build in typical case (building on x86 and not working on some non-x86 platform-specific functionality).
However, for `x.py test` to pass successfully you have to add ARM and SystemZ to the target list as well (`targets = "X86;ARM;SystemZ"`), because two tests (`compile-fail/issue-37131.rs` and `run-make\target-without-atomics`) require these architectures to be enabled in LLVM.
This patch moves `compile-fail/issue-37131.rs` from SystemZ to ARM, so `targets = "X86;ARM"` becomes sufficient for running the full test suite without errors.
2017-02-25 14:13:21 +02:00
Eduard-Mihai Burtescu
a8ab222fd5 Rollup merge of #39914 - raphlinus:mx_handle_wait, r=alexcrichton
Follow rename of mx_handle_wait Magenta syscalls

The mx_handle_wait_* syscalls in Magenta were renamed to
mx_object_wait. The syscall is used in the Magenta/Fuchsia
implementation of std::process, to wait on child processes.

In addition, this patch enables the use of the system provided
libbacktrace library on Fuchsia targets. Symbolization is not yet
working, but at least it allows printing hex addresses in a backtrace
and makes building succeed when the backtrace feature is not disabled.
2017-02-25 14:13:20 +02:00
Eduard-Mihai Burtescu
aa7eb65123 Rollup merge of #39905 - estebank:useless-error, r=arielb1
Properly display note/expected details

Given a file

```rust
fn takes_cb(f: fn(i8)) {}

fn main() {
    fn callback(x: i32) {}
    takes_cb(callback)
}
```

output

```rust
error[E0308]: mismatched types
 --> file2.rs:5:22
  |
5 |             takes_cb(callback)
  |                      ^^^^^^^^ expected i8, found i32
  |
  = note: expected type `fn(i8)`
             found type `fn(i32) {main::callback}`
```

Fix #39343.
2017-02-25 14:13:19 +02:00
Eduard-Mihai Burtescu
a6924177e4 Rollup merge of #39903 - binarycrusader:issue-39901, r=alexcrichton
add solaris sparcv9 support

Fixes #39901
2017-02-25 14:13:18 +02:00
Eduard-Mihai Burtescu
e31d46402d Rollup merge of #39888 - nagisa:on-fail-bootstrap, r=alexcrichton
[rustbuild] add a way to run command after failure

This is a simple way to workaround the debugging issues caused by the rustc
wrapper used in the bootstrap process. Namely, it uses some obscure environment
variables and you can't just copy the failed command and run it in the shell or
debugger to examine the failure more closely.

With `--on-fail` its possible to run an arbitrary command within exactly the
same environment under which rustc failed. Theres's multiple ways to use this
new flag:

$ python x.py build --stage=1 --on-fail=env

    would print a list of environment variables and the failed command, so a
    few copy-pastes and you now can run the same rust in your shell outside the
    bootstrap system.

$ python x.py build --stage=1 --on-fail=bash

    Is a more useful variation of the command above in that it launches a whole
    shell with environment already in place! All that's left to do is copy-paste
    the command just above the shell prompt!

Fixes #38686
Fixes #38221
2017-02-25 14:13:17 +02:00
Eduard-Mihai Burtescu
ad9079bae4 Rollup merge of #39864 - cramertj:normalize-breaks, r=nikomatsakis
Normalize labeled and unlabeled breaks

Part of #39849.
2017-02-25 14:13:16 +02:00
Eduard-Mihai Burtescu
46fed6e6fa Rollup merge of #39859 - GuillaumeGomez:rustdoc-test-relative-path, r=alexcrichton
Set rustdoc --test files' path relative to the current directory

r? @alexcrichton
2017-02-25 14:13:15 +02:00
Daniel Xu
07a80260a6 Move COMPILER_TESTS.md out of the root directory 2017-02-25 00:13:00 -06:00
bors
e78aa5d754 Auto merge of #40060 - alexcrichton:retry-downloads, r=aturon
rustbuild: Retry downloads by default

Don't rely on curl's --retry, it appears to not work for some errors like SSL
errors.
2017-02-25 05:50:08 +00:00
Phil Ruffwind
1f75085ae5 Add Gankro's table to nomicon/src/phantom-data.md
Original: https://github.com/rust-lang/rust/issues/30069#issuecomment-159928136

Testing confirms that:

  - PhantomData<fn() -> T> does not actually enable drop checking.
  - PhantomData<fn(T) -> T> is neither variant nor contravariant.
2017-02-25 00:25:13 -05:00
bors
19e5a82f89 Auto merge of #40084 - alexcrichton:update-sccache, r=aturon
Update sccache binaries on CI

Currently CI builds can fail spuriously during the LLVM build (#39003). I
believe this is due to sccache, and I believe that in turn was due to the fact
that the sccache server used to just be a raw mio server. Historically raw mio
servers are quite complicated to get right, but this is why we built Tokio! The
sccache server has been migrated to Tokio which I suspect would fix any latent
issues.

I have no confirmation of this (never been able to reproduce the deadlock
locally), but my hunch is that updating sccache to the master branch will fix
the timeouts during the LLVM build.

The binaries previously came from Gecko's infrastructure, but I've built new
ones by hand for Win/Mac/Linux and uploaded them to our CI bucket.
2017-02-25 03:10:23 +00:00
bors
7932349e95 Auto merge of #40072 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 11 pull requests

- Successful merges: #39777, #39815, #39845, #39886, #39940, #40010, #40030, #40048, #40050, #40052, #40071
- Failed merges:
2017-02-25 00:40:09 +00:00
Alex Crichton
255a87499d Update sccache binaries on CI
Currently CI builds can fail spuriously during the LLVM build (#39003). I
believe this is due to sccache, and I believe that in turn was due to the fact
that the sccache server used to just be a raw mio server. Historically raw mio
servers are quite complicated to get right, but this is why we built Tokio! The
sccache server has been migrated to Tokio which I suspect would fix any latent
issues.

I have no confirmation of this (never been able to reproduce the deadlock
locally), but my hunch is that updating sccache to the master branch will fix
the timeouts during the LLVM build.

The binaries previously came from Gecko's infrastructure, but I've built new
ones by hand for Win/Mac/Linux and uploaded them to our CI bucket.
2017-02-24 13:16:54 -08:00
bors
08230775a0 Auto merge of #39892 - petrochenkov:rt, r=alexcrichton
Fix test caching on Windows/GNU

Addresses https://github.com/rust-lang/rust/issues/36385#issuecomment-277131231

Previously the sysroot directory was purged on every build and mingw startup objects were rebuilt unconditionally and always triggered test reruns.
Now mingw startup objects are built in the native directory and then copied into the sysroot directory. They are also rebuilt only when necessary, so test caching works.
2017-02-24 16:06:15 +00:00
Tang Chenglong
6aed773448 Fix a typo 2017-02-24 22:01:26 +08:00
Guillaume Gomez
f26bbb3510 Rollup merge of #40071 - tomwhoiscontrary:pr-lets-apostrophes, r=GuillaumeGomez
Correct another typo in procedural macros chapter of the Book.

Another (and the only remaining) instance of the lets/let's mistake fixed in c8292fc / 36b00cf.

r? @steveklabnik
2017-02-24 13:23:01 +01:00
Guillaume Gomez
802a502ebd Rollup merge of #40052 - GuillaumeGomez:sunc_docs, r=frewsxcv
Add missing urls in MutexGuard docs

r? @frewsxcv
2017-02-24 13:23:00 +01:00
Guillaume Gomez
6f9e69a0fd Rollup merge of #40050 - DaseinPhaos:patch-3, r=steveklabnik
Update exception-safety.md

Fix variable name typo
2017-02-24 13:22:59 +01:00
Guillaume Gomez
173b725b89 Rollup merge of #40048 - jimblandy:fmt-arg-types-doc, r=alexcrichton
Update std::fmt module docs for landing of #33642.

Since #33642, it's no longer true that all references to a given format argument must use the same type. The docs don't seem to have been updated.
2017-02-24 13:22:58 +01:00
Guillaume Gomez
ef4d27d459 Rollup merge of #40030 - matklad:stack-docs, r=alexcrichton
Clarify thread::Builder::stack_size docs

Add two pieces of information:

* the size is in bytes
* the actual stack size might be bigger.

Also change the example to use a more realistic value of 32 kilobytes.

r? @steveklabnik
2017-02-24 13:22:57 +01:00
Guillaume Gomez
94a3172891 Rollup merge of #40010 - GuillaumeGomez:barrier-docs, r=frewsxcv
Add missing urls and examples into Barrier structs

r? @frewsxcv
2017-02-24 13:22:56 +01:00
Guillaume Gomez
01758c19b7 Rollup merge of #39940 - sgrif:sg-indentation, r=alexcrichton
Fix indentation of error message

So I just encountered this error for the first time. It's unclear what
it means, why I encountered it, or how to fix it. But worst of all, it
has a random newline and weird indentation! This commit fixes that last
bit.

<img width="680" alt="screen shot 2017-02-18 at 4 35 36 pm" src="https://cloud.githubusercontent.com/assets/1529387/23097087/0ef5ac4a-f5f9-11e6-9132-18ce759f7092.png">
2017-02-24 13:22:55 +01:00
Guillaume Gomez
3b10300e0a Rollup merge of #39886 - mbrubeck:doc-edit, r=steveklabnik
Additional docs for Vec, String, and slice trait impls

r? @steveklabnik
2017-02-24 13:22:54 +01:00
Guillaume Gomez
03e9e00d85 Rollup merge of #39845 - JDemler:master, r=steveklabnik
Add Documentation for Custom Attributes and Error Reporting in Procedural Macros

This fixes #39821 .

I'm not sure if the process of how to access custom attributes should be documented as well.
But I feel, that this should rather be documented in `syn`
2017-02-24 13:22:53 +01:00
Guillaume Gomez
c07aa14201 Rollup merge of #39815 - oli-obk:patch-3, r=aturon
enable tools to use test runners programmatically
2017-02-24 13:22:52 +01:00
Guillaume Gomez
246b1db3ec Rollup merge of #39777 - mina86:gib, r=steveklabnik
book: binary prefixed are defined by IEC and not in SI

Binary prefixes (such as Gi for ‘gibi-’ in GiB) are defined by
International Electrotechnical Commission (IEC) and not in the
International System of Units (SI).

Though to be honest I’d just reword the previous paragraph to use ‘1 GiB’.
2017-02-24 13:22:51 +01:00
Tom Anderson
7c52cadfc3 Correct another typo in procedural macros chapter of the Book. 2017-02-24 11:48:42 +00:00
bors
9f082d2111 Auto merge of #39714 - vadimcn:top-level-expn2, r=michaelwoerister
Code cleanup.

r? @michaelwoerister

Just figured out that the same condition may be expressed much more cleanly.
Sorry for the churn!
2017-02-24 07:30:11 +00:00
bors
674af8c7f5 Auto merge of #39851 - alexcrichton:verify-unstable, r=brson
test: Verify all sysroot crates are unstable

As we continue to add more crates to the compiler and use them to implement
various features we want to be sure we're not accidentally expanding the API
surface area of the compiler! To that end this commit adds a new `run-make` test
which will attempt to `extern crate foo` all crates in the sysroot, verifying
that they're all unstable.

This commit discovered that the `std_shim` and `test_shim` crates were
accidentally stable and fixes the situation by deleting those shims. The shims
are no longer necessary due to changes in Cargo that have happened since they
were originally incepted.
2017-02-24 02:40:16 +00:00
Vadim Petrochenkov
0982a28304 rposition() -> rev().position() (#2) 2017-02-23 20:57:16 -05:00
est31
77f131da1a Review changes
* use more convenient mk_substs function
	* remove type annotations
	* use map_bound one level farther outside
	* style improvements
2017-02-24 00:32:21 +01:00
est31
21c38988f4 Two more tests 2017-02-23 22:34:17 +01:00
est31
f753a6ef02 Feature gate 2017-02-23 22:32:25 +01:00
est31
1b9b322883 Implement non-capturing closure to fn coercion 2017-02-23 22:32:22 +01:00
Ariel Ben-Yehuda
87e544bca5 use a more conservative inhabitableness rule
This is a [breaking-change] from 1.15, because this used to compile:

```Rust
enum Void {}
fn foo(x: &Void) {
    match x {}
}
```
2017-02-23 22:46:22 +02:00
Peter Wagenet
69c5359bf2 Add tests for lib defaults 2017-02-23 11:25:26 -08:00
Vadim Petrochenkov
227eab0b7f Fix tests on Windows (#1) 2017-02-23 13:25:23 -05:00