]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAuto merge of #39291 - Freyskeyd:check_context_E0423, r=petrochenkov
bors [Sat, 29 Apr 2017 15:18:52 +0000 (15:18 +0000)]
Auto merge of #39291 - Freyskeyd:check_context_E0423, r=petrochenkov

Checker:: Execute levenshtein before other context checking

As explain [here]() i think it's better to check for a miss typing before checking context dependent help.

```rust
struct Handle {}

struct Something {
     handle: Handle
}

fn main() {
     let handle: Handle = Handle {};

     let s: Something = Something {
         // Checker detect an error and propose a solution with `Handle { /* ... */ }`
         // but it's a miss typing of `handle`
         handle: Handle
    };
}
```

Ping: @nagisa for #39226

Signed-off-by: Freyskeyd <simon.paitrault@gmail.com>
7 years agoAuto merge of #41588 - cengizIO:master, r=nikomatsakis
bors [Sat, 29 Apr 2017 12:59:45 +0000 (12:59 +0000)]
Auto merge of #41588 - cengizIO:master, r=nikomatsakis

use diff crate for compile-fail test diagnostics #41474

Hello!

This fixes #41474

We were using a custom implementation to dump the differences between expected and actual outputs of compile-fail tests.

I removed this internal implementation and added `diff` crate as a new dependency to `compile-fail`.

Again, huge thanks to @nikomatsakis for guiding.

7 years agoAuto merge of #41623 - alexcrichton:update-sccache, r=TimNN
bors [Sat, 29 Apr 2017 08:36:57 +0000 (08:36 +0000)]
Auto merge of #41623 - alexcrichton:update-sccache, r=TimNN

ci: Update sccache build

Pulls in mozilla/sccache@ef0d77543 to fix #40240 again after the builds included
in #41447 forgot to include the mio fixed included in #41076.

Closes #40240

7 years agoci: Update sccache build
Alex Crichton [Sat, 29 Apr 2017 07:29:54 +0000 (00:29 -0700)]
ci: Update sccache build

Pulls in mozilla/sccache@ef0d77543 to fix #40240 again after the builds included
in #41447 forgot to include the mio fixed included in #41076.

Closes #40240

7 years agoAuto merge of #41564 - gaurikholkar:master, r=nikomatsakis
bors [Sat, 29 Apr 2017 06:16:22 +0000 (06:16 +0000)]
Auto merge of #41564 - gaurikholkar:master, r=nikomatsakis

Disable ref hint for pattern in let and adding ui tests #40402

A fix to #40402

The `to prevent move, use ref e or ref mut e ` has been disabled.
```
fn main() {
    let v = vec![String::from("oh no")];

    let e = v[0];
}
```
now gives
```
error[E0507]: cannot move out of indexed content
 --> example.rs:4:13
  |
4 |     let e = v[0];
  |             ^^^^ cannot move out of indexed content

error: aborting due to previous error
```
I have added ui tests for the same and also modified a compile-fail test.

7 years agoAuto merge of #41577 - Keruspe:master, r=alexcrichton
bors [Sat, 29 Apr 2017 03:56:09 +0000 (03:56 +0000)]
Auto merge of #41577 - Keruspe:master, r=alexcrichton

rustbuild improvements

Properly hook up cargo and rls in the build phase, and install them, when extended build is enabled.

7 years agoAuto merge of #41542 - petrochenkov:objpars2, r=nikomatsakis
bors [Fri, 28 Apr 2017 22:28:11 +0000 (22:28 +0000)]
Auto merge of #41542 - petrochenkov:objpars2, r=nikomatsakis

syntax: Parse trait object types starting with a lifetime bound

Fixes https://github.com/rust-lang/rust/issues/39085

This was originally implemented in https://github.com/rust-lang/rust/pull/40043, then reverted, then there was some [agreement](https://github.com/rust-lang/rust/issues/39318#issuecomment-289108720) that it should be supported.
(This is hopefully the last PR related to bound parsing.)

7 years agoAuto merge of #41368 - nikomatsakis:incr-comp-dep-tracking-map, r=eddyb
bors [Fri, 28 Apr 2017 18:53:24 +0000 (18:53 +0000)]
Auto merge of #41368 - nikomatsakis:incr-comp-dep-tracking-map, r=eddyb

make *most* maps private

Currently we access the `DepTrackingMap` fields directly rather than using the query accessors. This seems bad. This branch removes several such uses, but not all, and extends the macro so that queries can hide their maps (so we can prevent regressions). The extension to the macro is kind of ugly :/ but couldn't find a simple way to do it otherwise (I guess I could use a nested macro...). Anyway I figure it's only temporary.

r? @eddyb

7 years agorefac Move levenchstein before context dependent check
Freyskeyd [Tue, 18 Apr 2017 11:28:05 +0000 (13:28 +0200)]
refac Move levenchstein before context dependent check

Signed-off-by: Freyskeyd <simon.paitrault@gmail.com>
7 years agoAuto merge of #41575 - alexcrichton:android-qemu-server, r=TimNN
bors [Fri, 28 Apr 2017 16:10:08 +0000 (16:10 +0000)]
Auto merge of #41575 - alexcrichton:android-qemu-server, r=TimNN

travis: Parallelize tests on Android

Currently our slowest test suite on android, run-pass, takes over 5 times longer
than the x86_64 component (~400 -> ~2200s). Typically QEMU emulation does indeed
add overhead, but not 5x for this kind of workload. One of the slowest parts of
the Android process is that *compilation* happens serially. Tests themselves
need to run single-threaded on the emulator (due to how the test harness works)
and this forces the compiles themselves to be single threaded.

Now Travis gives us more than one core per machine, so it'd be much better if we
could take advantage of them! The emulator itself is still fundamentally
single-threaded, but we should see a nice speedup by sending binaries for it to
run much more quickly.

It turns out that we've already got all the toos to do this in-tree. The
qemu-test-{server,client} that are in use for the ARM Linux testing are a
perfect match for the Android emulator. This commit migrates the custom adb
management code in compiletest/rustbuild to the same qemu-test-{server,client}
implementation that ARM Linux uses.

This allows us to lift the parallelism restriction on the compiletest test
suites, namely run-pass. Consequently although we'll still basically run the
tests themselves in single threaded mode we'll be able to compile all of them in
parallel, keeping the pipeline much more full hopefully and using more cores for
the work at hand. Additionally the architecture here should be a bit speedier as
it should have less overhead than adb which is a whole new process on both the
host and the emulator!

Locally on an 8 core machine I've seen the run-pass test suite speed up from
taking nearly an hour to only taking 5 minutes. I don't think we'll see quite a
drastic speedup on Travis but I'm hoping this change can place the Android tests
well below 2 hours instead of just above 2 hours.

Because the client/server here are now repurposed for more than just QEMU,
they've been renamed to `remote-test-{server,client}`.

Note that this PR does not currently modify how debuginfo tests are executed on
Android. While parallelizable it wouldn't be quite as easy, so that's left to
another day. Thankfull that test suite is much smaller than the run-pass test
suite.

7 years agointroduce ability to if we have typeck-tables for a given def-id
Niko Matsakis [Fri, 28 Apr 2017 13:52:56 +0000 (09:52 -0400)]
introduce ability to if we have typeck-tables for a given def-id

And use this in save-analysis, which used to read the map directly.
This is an attempt to sidestep the failure occuring on homu that I
cannot reproduce.

7 years agoAuto merge of #41508 - michaelwoerister:generic-path-remapping, r=alexcrichton
bors [Fri, 28 Apr 2017 12:09:37 +0000 (12:09 +0000)]
Auto merge of #41508 - michaelwoerister:generic-path-remapping, r=alexcrichton

Implement a file-path remapping feature in support of debuginfo and reproducible builds

This PR adds the `-Zremap-path-prefix-from`/`-Zremap-path-prefix-to` commandline option pair and is a more general implementation of #41419. As opposed to the previous attempt, this implementation should enable reproducible builds regardless of the working directory of the compiler.

This implementation of the feature is more general in the sense that the re-mapping will affect *all* paths the compiler emits, including the ones in error messages.

r? @alexcrichton

7 years agoDisable path remapping test on Windows.
Michael Woerister [Fri, 28 Apr 2017 11:30:07 +0000 (13:30 +0200)]
Disable path remapping test on Windows.

7 years agoAdding documentation, indentation fixes
gaurikholkar [Thu, 27 Apr 2017 20:26:12 +0000 (13:26 -0700)]
Adding documentation, indentation fixes

7 years agomake `ty` and `impl_trait_ref` private
Niko Matsakis [Tue, 18 Apr 2017 15:50:21 +0000 (11:50 -0400)]
make `ty` and `impl_trait_ref` private

This requires copying out the cycle error to avoid a cyclic borrow.  Is
this a problem? Are there paths where we expect cycles to arise and not
result in errors? (In such cases, we could add a faster way to test for
cycle.)

7 years agoallow maps to be made private or public
Niko Matsakis [Tue, 18 Apr 2017 14:55:40 +0000 (10:55 -0400)]
allow maps to be made private or public

Didn't get around to removing all public access.

7 years agorustbuild: only build cargo for host
Marc-Antoine Perennou [Fri, 28 Apr 2017 08:48:49 +0000 (10:48 +0200)]
rustbuild: only build cargo for host

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
7 years agoDisable ref hint for pattern in let and adding ui-tests.
gaurikholkar [Sat, 15 Apr 2017 04:04:37 +0000 (21:04 -0700)]
Disable ref hint for pattern in let and adding ui-tests.

7 years agodo not access `typeck_tables` map directly
Niko Matsakis [Tue, 18 Apr 2017 14:55:19 +0000 (10:55 -0400)]
do not access `typeck_tables` map directly

7 years agodo not access `associated_item` map directly
Niko Matsakis [Tue, 18 Apr 2017 14:54:47 +0000 (10:54 -0400)]
do not access `associated_item` map directly

7 years agodo not access `inherited_impls` map directly
Niko Matsakis [Tue, 18 Apr 2017 14:53:35 +0000 (10:53 -0400)]
do not access `inherited_impls` map directly

7 years agoAuto merge of #41598 - frewsxcv:rollup, r=frewsxcv
bors [Fri, 28 Apr 2017 04:31:27 +0000 (04:31 +0000)]
Auto merge of #41598 - frewsxcv:rollup, r=frewsxcv

Rollup of 4 pull requests

- Successful merges: #41534, #41546, #41571, #41583
- Failed merges:

7 years agoRollup merge of #41583 - arielb1:cross-constant, r=eddyb
Corey Farwell [Fri, 28 Apr 2017 04:29:37 +0000 (00:29 -0400)]
Rollup merge of #41583 - arielb1:cross-constant, r=eddyb

don't ICE on cross-crate associated const type mismatch

Fixes #41549.

r? @eddyb

7 years agoRollup merge of #41571 - alexcrichton:fix-windows-mingw, r=brson
Corey Farwell [Fri, 28 Apr 2017 04:29:36 +0000 (00:29 -0400)]
Rollup merge of #41571 - alexcrichton:fix-windows-mingw, r=brson

windows: Copy libwinpthread-1.dll into libdir bin

Recently we switched from the win32 MinGW toolchain to the pthreads-based
toolchain. We ship `gcc.exe` from this toolchain with the `rust-mingw` package
in the standard distribution but the pthreads version of `gcc.exe` depends on
`libwinpthread-1.dll`. While we're shipping this DLL for the compiler to depend
on we're not shipping it for gcc. As a workaround just copy the dll to gcc.exe
location and don't attempt to share for now.

cc https://github.com/rust-lang/rust/issues/31840#issuecomment-297478538

7 years agoRollup merge of #41534 - achernyak:master, r=eddyb
Corey Farwell [Fri, 28 Apr 2017 04:29:35 +0000 (00:29 -0400)]
Rollup merge of #41534 - achernyak:master, r=eddyb

query for describe_def

Resolves `fn describe_def(&self, def: DefId) -> Option<Def>;` of #41417.

r? @nikomatsakis I would greatly appreciate a review. I hope I covered everything described in the pr.

7 years agotravis: Parallelize tests on Android
Alex Crichton [Wed, 26 Apr 2017 15:52:19 +0000 (08:52 -0700)]
travis: Parallelize tests on Android

Currently our slowest test suite on android, run-pass, takes over 5 times longer
than the x86_64 component (~400 -> ~2200s). Typically QEMU emulation does indeed
add overhead, but not 5x for this kind of workload. One of the slowest parts of
the Android process is that *compilation* happens serially. Tests themselves
need to run single-threaded on the emulator (due to how the test harness works)
and this forces the compiles themselves to be single threaded.

Now Travis gives us more than one core per machine, so it'd be much better if we
could take advantage of them! The emulator itself is still fundamentally
single-threaded, but we should see a nice speedup by sending binaries for it to
run much more quickly.

It turns out that we've already got all the tools to do this in-tree. The
qemu-test-{server,client} that are in use for the ARM Linux testing are a
perfect match for the Android emulator. This commit migrates the custom adb
management code in compiletest/rustbuild to the same qemu-test-{server,client}
implementation that ARM Linux uses.

This allows us to lift the parallelism restriction on the compiletest test
suites, namely run-pass. Consequently although we'll still basically run the
tests themselves in single threaded mode we'll be able to compile all of them in
parallel, keeping the pipeline much more full and using more cores for the work
at hand. Additionally the architecture here should be a bit speedier as it
should have less overhead than adb which is a whole new process on both the host
and the emulator!

Locally on an 8 core machine I've seen the run-pass test suite speed up from
taking nearly an hour to only taking 6 minutes. I don't think we'll see quite a
drastic speedup on Travis but I'm hoping this change can place the Android tests
well below 2 hours instead of just above 2 hours.

Because the client/server here are now repurposed for more than just QEMU,
they've been renamed to `remote-test-{server,client}`.

Note that this PR does not currently modify how debuginfo tests are executed on
Android. While parallelizable it wouldn't be quite as easy, so that's left to
another day. Thankfully that test suite is much smaller than the run-pass test
suite.

As a final fix I discovered that the ARM and Android test suites were actually
running all library unit tests (e.g. stdtest, coretest, etc) twice. I've
corrected that to only run tests once which should also give a nice boost in
overall cycle time here.

7 years agoAuto merge of #41591 - frewsxcv:rollup, r=frewsxcv
bors [Fri, 28 Apr 2017 00:48:57 +0000 (00:48 +0000)]
Auto merge of #41591 - frewsxcv:rollup, r=frewsxcv

Rollup of 7 pull requests

- Successful merges: #41438, #41523, #41526, #41546, #41556, #41572, #41578
- Failed merges:

7 years agoRollup merge of #41578 - arielb1:missing-adjustment, r=eddyb
Corey Farwell [Thu, 27 Apr 2017 23:59:18 +0000 (19:59 -0400)]
Rollup merge of #41578 - arielb1:missing-adjustment, r=eddyb

typeck: resolve type vars before calling `try_index_step`

`try_index_step` does not resolve type variables by itself and would
fail otherwise. Also harden the failure path in `confirm` to cause less
confusing errors.

r? @eddyb

Fixes #41498.

beta-nominating because regression (caused by #41279).

7 years agoRollup merge of #41572 - frewsxcv:bump-mdbook, r=steveklabnik
Corey Farwell [Thu, 27 Apr 2017 23:59:17 +0000 (19:59 -0400)]
Rollup merge of #41572 - frewsxcv:bump-mdbook, r=steveklabnik

Bump mdbook dep to pick up new 'create missing' toggle feature.

This will avoid obscure Travis CI error messages:

* https://github.com/rust-lang/rust/pull/40290#issuecomment-294137045

Original mdbook issue:

* https://github.com/azerupi/mdBook/issues/253

mdbook PR:

* https://github.com/azerupi/mdBook/pull/254

7 years agoRollup merge of #41556 - pftbest:fix_msp430_codegen, r=alexcrichton
Corey Farwell [Thu, 27 Apr 2017 23:59:16 +0000 (19:59 -0400)]
Rollup merge of #41556 - pftbest:fix_msp430_codegen, r=alexcrichton

LLVM: Update submodule to fix incorrect codegen on MSP430.

The bug was reported by @akovaski here:
https://github.com/rust-embedded/rfcs/issues/20#issuecomment-296482148

~~P.S. Looks like this patch will conflict with Hexagon changes.~~

r? @alexcrichton

7 years agoRollup merge of #41526 - steveklabnik:gh35950, r=GuillaumeGomez
Corey Farwell [Thu, 27 Apr 2017 23:59:15 +0000 (19:59 -0400)]
Rollup merge of #41526 - steveklabnik:gh35950, r=GuillaumeGomez

Clean up TcpStream example

Fixes #35950

7 years agoRollup merge of #41523 - estebank:moved, r=arielb1
Corey Farwell [Thu, 27 Apr 2017 23:59:14 +0000 (19:59 -0400)]
Rollup merge of #41523 - estebank:moved, r=arielb1

Point at variable moved by closure

Fix #41482, #31752.

7 years agoRollup merge of #41438 - projektir:mpsc_docs, r=steveklabnik
Corey Farwell [Thu, 27 Apr 2017 23:59:13 +0000 (19:59 -0400)]
Rollup merge of #41438 - projektir:mpsc_docs, r=steveklabnik

Adding links and examples for various mspc pages #29377

Adding links and copying examples for the various Iterators; adding some extra stuff to `Sender`/`SyncSender`/`Receiver`.

7 years agoAuto merge of #41529 - bitshifter:issue-41479, r=eddyb
bors [Thu, 27 Apr 2017 21:54:07 +0000 (21:54 +0000)]
Auto merge of #41529 - bitshifter:issue-41479, r=eddyb

Add missing OperandPair struct field index adjustments. Fixes #41479.

This is a bug fix for a regression in https://github.com/rust-lang/rust/commit/6d841da4a0d7629f826117f99052e3d4a7997a7e.

7 years agouse diff crate for compile-fail test diagnostics #41474
Cengiz Can [Thu, 27 Apr 2017 19:41:18 +0000 (22:41 +0300)]
use diff crate for compile-fail test diagnostics #41474

7 years agoquery for describe_def
achernyak [Thu, 27 Apr 2017 18:27:16 +0000 (13:27 -0500)]
query for describe_def

7 years agodon't ICE on cross-crate associated const type mismatch
Ariel Ben-Yehuda [Thu, 27 Apr 2017 17:06:48 +0000 (20:06 +0300)]
don't ICE on cross-crate associated const type mismatch

Fixes #41549.

7 years agoAuto merge of #41447 - alexcrichton:sccache-everywhere, r=brson
bors [Thu, 27 Apr 2017 16:38:19 +0000 (16:38 +0000)]
Auto merge of #41447 - alexcrichton:sccache-everywhere, r=brson

appveyor: Use Ninja/sccache on MSVC

Now that the final bug fixes have been merged into sccache we can start
leveraging sccache on the MSVC builders on AppVeyor instead of relying on the
ad-hoc caching strategy of trigger files and whatnot.

7 years agoBump mdbook dep to pick up new 'create missing' toggle feature.
Corey Farwell [Thu, 27 Apr 2017 02:04:04 +0000 (22:04 -0400)]
Bump mdbook dep to pick up new 'create missing' toggle feature.

This will avoid obscure Travis CI error messages:

* https://github.com/rust-lang/rust/pull/40290#issuecomment-294137045

Original mdbook issue:

* https://github.com/azerupi/mdBook/issues/253

mdbook PR:

* https://github.com/azerupi/mdBook/pull/254

7 years agoappveyor: Use Ninja/sccache on MSVC
Alex Crichton [Sat, 25 Feb 2017 17:53:46 +0000 (09:53 -0800)]
appveyor: Use Ninja/sccache on MSVC

Now that the final bug fixes have been merged into sccache we can start
leveraging sccache on the MSVC builders on AppVeyor instead of relying on the
ad-hoc caching strategy of trigger files and whatnot.

7 years agotravis: Update sccache build used
Alex Crichton [Wed, 19 Apr 2017 15:58:27 +0000 (08:58 -0700)]
travis: Update sccache build used

This build is no longer a forked version with temporary bugfixes, everything
should be upstreamed!

7 years agotypeck: resolve type vars before calling `try_index_step`
Ariel Ben-Yehuda [Thu, 27 Apr 2017 13:40:49 +0000 (16:40 +0300)]
typeck: resolve type vars before calling `try_index_step`

`try_index_step` does not resolve type variables by itself and would
fail otherwise. Also harden the failure path in `confirm` to cause less
confusing errors.

7 years agoAuto merge of #41507 - arielb1:symbol-cache, r=nikomatsakis
bors [Thu, 27 Apr 2017 13:17:55 +0000 (13:17 +0000)]
Auto merge of #41507 - arielb1:symbol-cache, r=nikomatsakis

cache symbol names in ty::maps

this fixes a performance regression introduced in commit 39a58c38a0b9ac9e822a1732f073abe8ddf65cfb.

r? @nikomatsakis

7 years agorustbuild: install rustc after cargo and rls
Marc-Antoine Perennou [Thu, 27 Apr 2017 13:05:29 +0000 (15:05 +0200)]
rustbuild: install rustc after cargo and rls

This way its files take precedence (e.g. README.md and stuff)

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
7 years agoAuto merge of #41433 - estebank:constructor, r=michaelwoerister
bors [Thu, 27 Apr 2017 10:47:56 +0000 (10:47 +0000)]
Auto merge of #41433 - estebank:constructor, r=michaelwoerister

Do not show `::{{constructor}}` on tuple struct diagnostics

Fix #41313.

7 years agorustbuild: install cargo and rls when extended build is enabled
Marc-Antoine Perennou [Thu, 27 Apr 2017 09:53:18 +0000 (11:53 +0200)]
rustbuild: install cargo and rls when extended build is enabled

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
7 years agorustbuild: add rls_package_vers
Marc-Antoine Perennou [Thu, 27 Apr 2017 09:49:03 +0000 (11:49 +0200)]
rustbuild: add rls_package_vers

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
7 years agorustbuild: pass version number as param in install phase
Marc-Antoine Perennou [Thu, 27 Apr 2017 09:52:48 +0000 (11:52 +0200)]
rustbuild: pass version number as param in install phase

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
7 years agorustbuild: build cargo and rls as part of extended build
Marc-Antoine Perennou [Thu, 27 Apr 2017 09:51:02 +0000 (11:51 +0200)]
rustbuild: build cargo and rls as part of extended build

Build them directly in the `./x.py build` phase, don't wait for
`./x.py dist`

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
7 years agoUpdate LLVM to fix incorrect codegen on MSP430.
Vadzim Dambrouski [Wed, 26 Apr 2017 14:04:25 +0000 (17:04 +0300)]
Update LLVM to fix incorrect codegen on MSP430.

The bug was reported by @akovaski here:
https://github.com/rust-embedded/rfcs/issues/20#issuecomment-296482148

7 years agoAdding links and examples for various mspc pages #29377
projektir [Fri, 21 Apr 2017 03:53:38 +0000 (23:53 -0400)]
Adding links and examples for various mspc pages #29377

7 years agoAuto merge of #37860 - giannicic:defaultimpl, r=nagisa
bors [Thu, 27 Apr 2017 02:48:17 +0000 (02:48 +0000)]
Auto merge of #37860 - giannicic:defaultimpl, r=nagisa

#37653 support `default impl` for specialization

this commit implements the first step of the `default impl` feature:

> all items in a `default impl` are (implicitly) `default` and hence
> specializable.

In order to test this feature I've copied all the tests provided for the
`default` method implementation (in run-pass/specialization and
compile-fail/specialization directories) and moved the `default` keyword
from the item to the impl.
See [referenced](https://github.com/rust-lang/rust/issues/37653) issue for further info

r? @aturon

7 years agowindows: Copy libwinpthread-1.dll into libdir bin
Alex Crichton [Thu, 27 Apr 2017 01:35:01 +0000 (18:35 -0700)]
windows: Copy libwinpthread-1.dll into libdir bin

Recently we switched from the win32 MinGW toolchain to the pthreads-based
toolchain. We ship `gcc.exe` from this toolchain with the `rust-mingw` package
in the standard distribution but the pthreads version of `gcc.exe` depends on
`libwinpthread-1.dll`. While we're shipping this DLL for the compiler to depend
on we're not shipping it for gcc. As a workaround just copy the dll to gcc.exe
location and don't attempt to share for now.

cc https://github.com/rust-lang/rust/issues/31840#issuecomment-297478538

7 years agoAuto merge of #41567 - arielb1:rollup, r=arielb1
bors [Thu, 27 Apr 2017 00:04:03 +0000 (00:04 +0000)]
Auto merge of #41567 - arielb1:rollup, r=arielb1

Rollup of 9 pull requests

- Successful merges: #41370, #41456, #41493, #41499, #41501, #41524, #41546, #41550, #41552
- Failed merges:

7 years agoRollup merge of #41552 - jessicah:updated-num-cpus-dep, r=alexcrichton
Ariel Ben-Yehuda [Wed, 26 Apr 2017 22:11:10 +0000 (22:11 +0000)]
Rollup merge of #41552 - jessicah:updated-num-cpus-dep, r=alexcrichton

Update num_cpus dependency to 1.x (1.4.0)

7 years agoRollup merge of #41550 - wesleywiser:fix_33287, r=estebank
Ariel Ben-Yehuda [Wed, 26 Apr 2017 22:11:09 +0000 (22:11 +0000)]
Rollup merge of #41550 - wesleywiser:fix_33287, r=estebank

Add a regression test for ICE #33287

Fixes #33287

7 years agoRollup merge of #41546 - cuviper:reduced-rust-src, r=alexcrichton
Ariel Ben-Yehuda [Wed, 26 Apr 2017 22:11:08 +0000 (22:11 +0000)]
Rollup merge of #41546 - cuviper:reduced-rust-src, r=alexcrichton

Shrink the rust-src component

Before this change, the installable rust-src component had essentially the same contents as the rustc-src dist tarball, just additionally wrapped in a rust-installer.  As discussed on [internals], rust-src is only meant to support uses for the standard library, so it doesn't really need the rest of the compiler sources.

Now rust-src only contains libstd and its path dependencies, which roughly matches the set of crates that have rust-analysis data.  The result is **significantly** smaller, from 36MB to 1.3MB compressed, and from 247MB to 8.5MB uncompressed.

[internals]: https://internals.rust-lang.org/t/minimizing-the-rust-src-component/5117

7 years agoRollup merge of #41524 - michaelwu:basic-hexagon, r=alexcrichton
Ariel Ben-Yehuda [Wed, 26 Apr 2017 22:11:07 +0000 (22:11 +0000)]
Rollup merge of #41524 - michaelwu:basic-hexagon, r=alexcrichton

Add Hexagon support

This requires an updated LLVM with https://reviews.llvm.org/D31999 and https://reviews.llvm.org/D32000 to build libcore.

A basic hello world builds and runs successfully on the hexagon simulator. libcore is fine with LLVM fixes, but libstd requires a lot more work since there's a custom rtos running on most hexagon cores. Running Linux sounds possible though, so maybe getting linux + musl going would be easier.

Here's the target file I've been using for testing
```
{
    "arch": "hexagon",
    "llvm-target": "hexagon-unknown-elf",
    "os": "none",
    "target-endian": "little",
    "target-pointer-width": "32",

    "data-layout": "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048",
    "linker": "hexagon-clang",
    "linker-flavor": "gcc",
    "executables": true,
    "cpu": "hexagonv60"
}
```

7 years agoRollup merge of #41501 - GuillaumeGomez:invalid_module_location, r=jseyfried
Ariel Ben-Yehuda [Wed, 26 Apr 2017 22:11:06 +0000 (22:11 +0000)]
Rollup merge of #41501 - GuillaumeGomez:invalid_module_location, r=jseyfried

Invalid module location

Fixes #38110.

r? @jseyfried

7 years agoRollup merge of #41499 - steveklabnik:gh25164, r=alexcrichton
Ariel Ben-Yehuda [Wed, 26 Apr 2017 22:11:05 +0000 (22:11 +0000)]
Rollup merge of #41499 - steveklabnik:gh25164, r=alexcrichton

Address platform-specific behavior in TcpStream::shutdown

Fixes #25164

r? @rust-lang/libs from the GitHub thread, it seems like documenting this behavior is okay, but I want to make sure that's what you want.

7 years agoRollup merge of #41493 - scottmcm:fix-step-replace, r=sfackler
Ariel Ben-Yehuda [Wed, 26 Apr 2017 22:11:04 +0000 (22:11 +0000)]
Rollup merge of #41493 - scottmcm:fix-step-replace, r=sfackler

Step::replace_one should put a one, not a zero (Issue #41492)

Turns out all six of the replace_* impls were backwards.

7 years agoRollup merge of #41456 - jessicah:haiku-support, r=alexcrichton
Ariel Ben-Yehuda [Wed, 26 Apr 2017 22:11:03 +0000 (22:11 +0000)]
Rollup merge of #41456 - jessicah:haiku-support, r=alexcrichton

Haiku: fix initial platform support

7 years agoRollup merge of #41370 - malbarbo:android-bootstrap, r=alexcrichton
Ariel Ben-Yehuda [Wed, 26 Apr 2017 22:11:02 +0000 (22:11 +0000)]
Rollup merge of #41370 - malbarbo:android-bootstrap, r=alexcrichton

Add bootstrap support for android

7 years agoAuto merge of #41563 - aidanhs:aphs-fix-spurious-osx-openssl-failure, r=alexcrichton
bors [Wed, 26 Apr 2017 21:26:14 +0000 (21:26 +0000)]
Auto merge of #41563 - aidanhs:aphs-fix-spurious-osx-openssl-failure, r=alexcrichton

Make sure openssl compiles with only one core

This is (hopefully) a fix for the osx openssl spurious failure - #40417.

The intermittent failures and failing in different ways made me think of a race condition. But programs are parallel make safe right? [Not openssl](https://github.com/openssl/openssl/issues/298). But we don't do a parallel make on openssl [do we](https://github.com/rust-lang/rust/blob/8c4f2c64c6759a82f143e23964a46a65c67509c9/src/bootstrap/native.rs#L309)? This confused me, except "Waiting for unfinished jobs" is present in the logs...which is evidence of a parallel make!

It turns out that when we invoke to top level target [in run.sh](https://github.com/rust-lang/rust/blob/036983201d4e9aeb5c5e56e47c305971972b2569/src/ci/run.sh#L75-L77), make will [pass the flags downwards](https://www.gnu.org/software/make/manual/html_node/Options_002fRecursion.html) in order to take advantage of parallelism in sub-makes. Of course, we don't want this in openssl! Override this by explicitly disabling parallelism on the command line.

I don't know why this hasn't happened on anything except OSX. Maybe Linux binutils check if the file is in use?

r? @alexcrichton

7 years agoMake sure openssl compiles with only one core
Aidan Hobson Sayers [Wed, 26 Apr 2017 20:21:27 +0000 (21:21 +0100)]
Make sure openssl compiles with only one core

Fixes #40417

7 years agoEnable building the LLVM Hexagon target
Michael Wu [Tue, 18 Apr 2017 20:23:47 +0000 (16:23 -0400)]
Enable building the LLVM Hexagon target

7 years agoAuto merge of #41420 - alexcrichton:mingw-6.3.0, r=petrochenkov
bors [Wed, 26 Apr 2017 15:12:30 +0000 (15:12 +0000)]
Auto merge of #41420 - alexcrichton:mingw-6.3.0, r=petrochenkov

appveyor: Upgrade to gcc for mingw 6.3.0

This commit sort of brings back #40777 by upgrading back to 6.3.0. While
investigating #40546 it was discovered that 6.3.0 appears to not spurious
fail in the same way that 6.2.0 does (which we're currently using). The
workaround for #40184 contained in #40777 did not work so this commit also
contains a different workaround for the gdb issue. We will not download the
6.2.0 version of gdb and use that instead of the default version that comes with
6.3.0.

I'm going to optimistically say...

Closes #40546

7 years agodon't allocate in get_symbol_hash
Ariel Ben-Yehuda [Mon, 24 Apr 2017 17:32:11 +0000 (20:32 +0300)]
don't allocate in get_symbol_hash

7 years agorefactor away trans::symbol_map
Ariel Ben-Yehuda [Mon, 24 Apr 2017 17:27:59 +0000 (20:27 +0300)]
refactor away trans::symbol_map

7 years agocache symbol names in ty::maps
Ariel Ben-Yehuda [Mon, 24 Apr 2017 16:35:47 +0000 (19:35 +0300)]
cache symbol names in ty::maps

this fixes a performance regression introduced in commit
39a58c38a0b9ac9e822a1732f073abe8ddf65cfb.

7 years ago support `default impl` for specialization
Gianni Ciccarelli [Wed, 26 Apr 2017 03:17:48 +0000 (03:17 +0000)]
support `default impl` for specialization

    `[default] [unsafe] impl` and typecheck

7 years agoAdd some documentation for -Zremap-path-prefix to the unstable book
Michael Woerister [Wed, 26 Apr 2017 10:20:21 +0000 (12:20 +0200)]
Add some documentation for -Zremap-path-prefix to the unstable book

7 years agoappveyor: Upgrade to gcc for mingw 6.3.0
Alex Crichton [Thu, 20 Apr 2017 15:35:03 +0000 (08:35 -0700)]
appveyor: Upgrade to gcc for mingw 6.3.0

This commit sort of brings back #40777 by upgrading back to 6.3.0. While
investigating #40546 it was discovered that 6.3.0 appears to not spurious
fail in the same way that 6.2.0 does (which we're currently using). The
workaround for #40184 contained in #40777 did not work so this commit also
contains a different workaround for the gdb issue. We will not download the
6.2.0 version of gdb and use that instead of the default version that comes with
6.3.0.

I'm going to optimistically say...

Closes #40546

7 years agoMake codegen test for remap-path-prefix more thorough.
Michael Woerister [Wed, 26 Apr 2017 10:46:09 +0000 (12:46 +0200)]
Make codegen test for remap-path-prefix more thorough.

7 years agoremap-path-prefix: Validate number of commandline arguments passed.
Michael Woerister [Tue, 25 Apr 2017 08:59:29 +0000 (10:59 +0200)]
remap-path-prefix: Validate number of commandline arguments passed.

7 years agoImplement a file-path remapping feature in support of debuginfo and reproducible...
Michael Woerister [Mon, 24 Apr 2017 17:01:19 +0000 (19:01 +0200)]
Implement a file-path remapping feature in support of debuginfo and reproducible builds.

7 years agoAuto merge of #41352 - kennytm:macos-sanitizers, r=alexcrichton
bors [Wed, 26 Apr 2017 12:34:45 +0000 (12:34 +0000)]
Auto merge of #41352 - kennytm:macos-sanitizers, r=alexcrichton

Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin

[ASan](https://clang.llvm.org/docs/AddressSanitizer.html#supported-platforms) and [TSan](https://clang.llvm.org/docs/ThreadSanitizer.html#supported-platforms) are supported on macOS, and this commit enables their support.

The sanitizers are always built as `*.dylib` on Apple platforms, so they cannot be statically linked into the corresponding `rustc_?san.rlib`. The dylibs are directly copied to `lib/rustlib/x86_64-apple-darwin/lib/` instead.

Note, although Xcode also ships with their own copies of ASan/TSan dylibs, we cannot use them due to version mismatch.

----

~~There is a caveat: the sanitizer libraries are linked as `@rpath/` (due to https://reviews.llvm.org/D6018), so the user needs to additionally pass `-C rpath`:~~

**Edit:** Passing rpath is now automatic.

7 years agoAuto merge of #41504 - eddyb:query-api, r=nikomatsakis
bors [Wed, 26 Apr 2017 09:54:11 +0000 (09:54 +0000)]
Auto merge of #41504 - eddyb:query-api, r=nikomatsakis

Improve the librustc on-demand/query API ergonomics.

Queries are now performed through these two forms:
* `tcx.type_of(def_id)` (the most common usage)
* `tcx.at(span).type_of(def_id)` (to provide a more specific location in the cycle stack)

Several queries were renamed to work better as method names, i.e. by suffixing with `_of`.

r? @nikomatsakis

7 years agoAddress platform-specific behavior in TcpStream::shutdown
steveklabnik [Mon, 24 Apr 2017 11:20:16 +0000 (07:20 -0400)]
Address platform-specific behavior in TcpStream::shutdown

Fixes #25164

7 years agoClean up TcpStream example
steveklabnik [Tue, 25 Apr 2017 08:10:06 +0000 (04:10 -0400)]
Clean up TcpStream example

Fixes #35950

7 years agoAuto merge of #41258 - clarcharr:str_box_extras, r=Kimundi
bors [Wed, 26 Apr 2017 06:18:17 +0000 (06:18 +0000)]
Auto merge of #41258 - clarcharr:str_box_extras, r=Kimundi

More methods for str boxes. (reduce Box<[u8]> ↔ Box<str> transmutes)

This is a follow-up to #41096 that adds safer methods for converting between `Box<str>` and `Box<[u8]>`. They're gated under a different feature from the `&mut str` methods because they may be too niche to include in public APIs, although having them internally helps reduce the number of transmutes the standard library uses.

What's added:

* `From<Box<str>> for Box<[u8]>`
* `<Box<str>>::into_boxed_bytes` (just calls `Into::into`)
* `alloc::str` (new module)
* `from_boxed_utf8` and `from_boxed_utf8_unchecked`, defined in `alloc:str`, exported in `collections::str`
* exports `from_utf8_mut` in `collections::str` (missed from previous PR)

7 years agoCherry pick LLVM hexagon fixes
Michael Wu [Tue, 25 Apr 2017 22:50:41 +0000 (18:50 -0400)]
Cherry pick LLVM hexagon fixes

7 years agoPoint at variable moved by closure
Esteban Küber [Tue, 25 Apr 2017 03:25:30 +0000 (20:25 -0700)]
Point at variable moved by closure

7 years agoAuto merge of #41551 - frewsxcv:rollup, r=frewsxcv
bors [Wed, 26 Apr 2017 03:26:12 +0000 (03:26 +0000)]
Auto merge of #41551 - frewsxcv:rollup, r=frewsxcv

Rollup of 9 pull requests

- Successful merges: #39983, #41442, #41463, #41500, #41518, #41527, #41528, #41530, #41535
- Failed merges:

7 years agoUpdate num_cpus dependency to 1.x (1.4.0)
Jessica Hamilton [Wed, 26 Apr 2017 03:20:09 +0000 (15:20 +1200)]
Update num_cpus dependency to 1.x (1.4.0)

7 years agoRollup merge of #41535 - steveklabnik:gh37746, r=alexcrichton
Corey Farwell [Wed, 26 Apr 2017 03:06:01 +0000 (23:06 -0400)]
Rollup merge of #41535 - steveklabnik:gh37746, r=alexcrichton

Fix up vec guarnatee around capacity

Fixes #37746

r? @rust-lang/libs

7 years agoRollup merge of #41530 - GuillaumeGomez:vec-from, r=aturon
Corey Farwell [Wed, 26 Apr 2017 03:06:00 +0000 (23:06 -0400)]
Rollup merge of #41530 - GuillaumeGomez:vec-from, r=aturon

Implement From<&mut [T]> for Vec

Fixes #41386.

7 years agoRollup merge of #41528 - steveklabnik:gh33269, r=frewsxcv
Corey Farwell [Wed, 26 Apr 2017 03:05:59 +0000 (23:05 -0400)]
Rollup merge of #41528 - steveklabnik:gh33269, r=frewsxcv

Clarify "side effect" in peek's docs

Fixes #33269

/cc @tshepang

7 years agoRollup merge of #41527 - steveklabnik:gh41285, r=frewsxcv
Corey Farwell [Wed, 26 Apr 2017 03:05:58 +0000 (23:05 -0400)]
Rollup merge of #41527 - steveklabnik:gh41285, r=frewsxcv

Clarify the doc index

With regards to the unstable book, the reference, and the
processes involved.

Also, fix up a link by pointing to the new tracking issue rather than
the older one.

Fixes #41285

r? @frewsxcv

7 years agoRollup merge of #41518 - tbu-:pr_fix_cp_error, r=sfackler
Corey Farwell [Wed, 26 Apr 2017 03:05:58 +0000 (23:05 -0400)]
Rollup merge of #41518 - tbu-:pr_fix_cp_error, r=sfackler

Fix a copy-paste error in `Instant::sub_duration`

Fixes #41514.

7 years agoRollup merge of #41500 - steveklabnik:gh37866, r=frewsxcv
Corey Farwell [Wed, 26 Apr 2017 03:05:57 +0000 (23:05 -0400)]
Rollup merge of #41500 - steveklabnik:gh37866, r=frewsxcv

use the word 'length' in Vec::len's docs

Fixes #37866

7 years agoRollup merge of #41463 - SergioBenitez:master, r=alexcrichton
Corey Farwell [Wed, 26 Apr 2017 03:05:56 +0000 (23:05 -0400)]
Rollup merge of #41463 - SergioBenitez:master, r=alexcrichton

Add internal accessor methods to io::{Chain, Take}.

Resolves #29067.

7 years agoRollup merge of #41442 - tbu-:pr_writeall_interrupted, r=aturon
Corey Farwell [Wed, 26 Apr 2017 03:05:55 +0000 (23:05 -0400)]
Rollup merge of #41442 - tbu-:pr_writeall_interrupted, r=aturon

Specify behavior of `write_all` for `ErrorKind::Interrupted` errors

Also spell out that read and write operations should be retried on
`ErrorKind::Interrupted` errors.

Fixes #38494.

7 years agoRollup merge of #39983 - AndrewGaspar:rust-windbg, r=brson
Corey Farwell [Wed, 26 Apr 2017 03:05:54 +0000 (23:05 -0400)]
Rollup merge of #39983 - AndrewGaspar:rust-windbg, r=brson

Adds rust-windbg.cmd script

Adds rust-gdb/rust-lldb equivalent for windbg that loads the Rust .natvis files on start.

This change modifies the bootstrap code to add rust-windbg to bin and the .natvis files to lib/rustlib/etc.

Example usage from cmd or PowerShell:
```
rust-windbg -c "bu rs_f442289d74765418!rs::main;g" target\debug\rs.exe
```

7 years agoAvoid the hexagon backend on old versions of LLVM
Michael Wu [Tue, 25 Apr 2017 22:08:13 +0000 (18:08 -0400)]
Avoid the hexagon backend on old versions of LLVM

7 years agoAdd a regression test for ICE #33287
Wesley Wiser [Wed, 26 Apr 2017 02:55:58 +0000 (22:55 -0400)]
Add a regression test for ICE #33287

Fixes #33287

7 years agoAuto merge of #41332 - petrochenkov:privti, r=eddyb
bors [Tue, 25 Apr 2017 23:46:37 +0000 (23:46 +0000)]
Auto merge of #41332 - petrochenkov:privti, r=eddyb

Check privacy of trait items in all contexts

Fixes https://github.com/rust-lang/rust/issues/28514

This is a sufficiently rare scenario and it's currently guarded by `private_in_public` lint, so it shouldn't be a [breaking-change] in practice.

7 years agoReduce the contents of the rust-src component
Josh Stone [Tue, 25 Apr 2017 22:58:07 +0000 (15:58 -0700)]
Reduce the contents of the rust-src component

7 years agoBuild the rustc-src tarball before the rust-src component
Josh Stone [Tue, 25 Apr 2017 22:34:31 +0000 (15:34 -0700)]
Build the rustc-src tarball before the rust-src component

7 years agoParse trait object types starting with a lifetime bound
Vadim Petrochenkov [Wed, 22 Feb 2017 20:59:40 +0000 (23:59 +0300)]
Parse trait object types starting with a lifetime bound