Commit Graph

64592 Commits

Author SHA1 Message Date
Mark Simulacrum
812966717b Rollup merge of #42355 - bjorn3:patch-1, r=Mark-Simulacrum
Syntax highlight rust code in librustc/dep_graph/README.md
2017-06-02 09:10:46 -06:00
Mark Simulacrum
5775c9ec5f Rollup merge of #42343 - cuviper:install-executables, r=alexcrichton
Update rust-installer for Windows executable mode

It now marks a few whitelisted extensions as executable in the tarball,
so Windows packages can be extracted on other platforms and directly
execute install.sh.

It also includes a fix for the chmod on bulk dirs, so now the html docs
won't be marked executable en masse.

Fixes #42121
r? @alexcrichton
2017-06-02 09:10:45 -06:00
Mark Simulacrum
c7287d9c09 Rollup merge of #42335 - jcowgill:fingerprint-be, r=michaelwoerister
Don't byteswap Fingerprints when encoding

Byteswapping Fingerprints when encoding is unnessesary and breaks if the Fingerprint is later decoded on a machine with different endianness to the one it was encoded on.

Fixes #42239

This PR fixes a regression caused by #42082. @michaelwoerister
2017-06-02 09:10:44 -06:00
Mark Simulacrum
85e5e20363 Rollup merge of #42319 - Manishearth:const-extern, r=nikomatsakis
Improve error message for const extern fn

It's currently ``error: unmatched visibility `pub` ``, which is a nonsensical error in this context.
2017-06-02 09:10:43 -06:00
Mark Simulacrum
1316281f2d Rollup merge of #42310 - scottmcm:deprecate-range-stepby, r=alexcrichton
Deprecate range-specific `step_by`

Deprecation attributes and test updates only.

Was replaced by an any-iterator version in https://github.com/rust-lang/rust/pull/41439

Last follow-up (this release) to https://github.com/rust-lang/rust/pull/42110#issuecomment-303210138

r? @alexcrichton
2017-06-02 09:10:42 -06:00
Mark Simulacrum
551dd7c7a2 Rollup merge of #42225 - brson:vs2017, r=alexcrichton
Support VS 2017

Fixes #38584

This replaces all the MSVC linker logic with that from the 'gcc' crate. The code looks the same, but there could be regressions.

I've only tested this with x86_64.

r? @alexcrichton
cc @vadimcn @retep998
2017-06-02 09:10:42 -06:00
Mark Simulacrum
32f418f60a Rollup merge of #41981 - gamazeps:thread-detach, r=frewsxcv
[Doc] Expands `detach` documentation in `thread::JoinHande`.

Part of #29378 .

- Adds an example of a thread detaching.
- Expands what `detaching` means.

r? @steveklabnik
2017-06-02 09:10:41 -06:00
bors
d7798c3d17 Auto merge of #42128 - kennytm:travis-folder, r=alexcrichton
Improve Travis CI log (travis_fold, colors)

Result looks like (https://travis-ci.org/rust-lang/rust/jobs/234614611):

<details><summary>Full page screenshot</summary>

![1-fullpage](https://cloud.githubusercontent.com/assets/103023/26302841/2627c354-3f18-11e7-9299-52a2088639af.jpg)

</details>

---

* Bring back colors on Travis, which was disabled since #39036. Append `--color=always` to cargo when running in CI environment.
* Removed `set -x` from the shell scripts. The `retry` function already prints which command it is running, adding `-x` just adds noise to the output. Interesting information can be manually `echo`ed.
* Support `travis_fold`/`travis_time`. Matching pairs of these allow Travis CI to collapse the output in between. This greatly cut down the unnecessary "successful" output one need to scroll through before finding the failed statement.
* Passed `--quiet` to all tests, so tests not failing will not occupy a line of log, reducing bloat in the report.

Also include some minor changes, like changing the `script` of `.travis.yml` to execute a single-line command, so the log won't write the extremely long multi-line
`The command "if [ "$ALLOW_PR" = "" ] && [ "$TRAVIS_BRANCH" != "auto" ]; then … " exited with 0` at the end.
2017-06-02 12:14:14 +00:00
Felix Raimundo
b76b9e1467 Expands detach documentation in thread::JoinHande.
Part of #29378 .

- Adds an example of a thread detaching.
- Expands what `detaching` means.
2017-06-02 12:26:04 +02:00
bors
558cd1e393 Auto merge of #41670 - scottmcm:slice-rotate, r=alexcrichton
Add an in-place rotate method for slices to libcore

A helpful primitive for moving chunks of data around inside a slice.

For example, if you have a range selected and are drag-and-dropping it somewhere else (Example from [Sean Parent's talk](https://youtu.be/qH6sSOr-yk8?t=560)).

(If this should be an RFC instead of a PR, please let me know.)

Edit: changed example
2017-06-02 07:51:20 +00:00
bors
668e698bba Auto merge of #41418 - hirschenberger:prefetch-intrinsic, r=nagisa
Adding support for the llvm `prefetch` intrinsic

Optimize `slice::binary_search` by using prefetching.
2017-06-02 04:58:09 +00:00
Brian Anderson
da100fe0bb Support VS 2017
Fixes #38584
2017-06-01 20:41:38 +00:00
kennytm
6ac0787ff3
ci: Further tone down the test verbosity.
When `--quiet` is passed to rustbuild, suppress rustdoc test output unless
failure.

Added a `--quiet` flag to `tidy`, which suppresses the features table.

The actual `--quiet` flag is enabled in #42354.

Since details of failed tests will still be printed, and the name of slow
tests taking >60 to runtime will also be printed, the debugging difficulty
caused by information loss should be minimal; but it is very worthwhile to
keep the log under 10000 lines on Travis CI so that common errors can be
spotted without reading the raw log.
2017-06-02 01:22:37 +08:00
kennytm
1222b7a9d1
Change .travis.yml's language: minimal to generic.
There is no `minimal` language. Due to travis-ci/travis-ci#4895, it will
fallback to `ruby`, which certainly isn't what we want. `generic` is an
undocumented (travis-ci/docs-travis-ci-com#910) language that serves the
desired purpose.
2017-06-02 01:14:26 +08:00
kennytm
e6e5dc0e9c
ci: Improve log output (mainly Travis).
* Bring back colors on Travis, which was disabled since #39036.
  Append --color=always to cargo when running in CI environment.
* Removed `set -x` in the shell scripts. The `retry` function already
  prints which command it is running, add `-x` just add noise to the
  output.
* Support travis_fold/travis_time. Matching pairs of these allow Travis CI
  to collapse the output in between. This greatly cut down the unnecessary
  "successful" output one need to scroll through before finding the failed
  statement.
2017-06-02 01:14:26 +08:00
kennytm
1a1ea253f2
Added --color flag to compiletest. 2017-06-02 01:14:25 +08:00
kennytm
57356b36fc
Ignore some folders.
- /src/target -- created when trying to directly `cargo build` on a single
  package.
2017-06-02 01:14:25 +08:00
bjorn3
24671badce Syntax highlight rust code in librustc/dep_graph/README.md 2017-06-01 18:44:20 +02:00
bors
4ed2edaafe Auto merge of #42281 - eddyb:well-adjusted, r=nikomatsakis
Decompose Adjustment into smaller steps and remove the method map.

The method map held method callee information for:
* actual method calls (`x.f(...)`)
* overloaded unary, binary, indexing and call operators
* *every overloaded deref adjustment* (many can exist for each expression)

That last one was a historical ~~accident~~ hack, and part of the motivation for this PR, along with:
* a desire to compose adjustments more freely
* containing the autoderef logic better to avoid mutation within an inference snapshot
* not creating `TyFnDef` types which are incompatible with the original one
  * i.e. we used to take a`TyFnDef`'s `for<'a> &'a T -> &'a U` signature and instantiate `'a` using a region inference variable, *then* package the resulting `&'b T -> &'b U` signature in another `TyFnDef`, while keeping *the same* `DefId` and `Substs`
* to fix #3548 by explicitly writing autorefs for the RHS of comparison operators

Individual commits tell their own story, of "atomic" changes avoiding breaking semantics.

Future work based on this PR could include:
* removing the signature from `TyFnDef`, now that it's always "canonical"
  * some questions of variance remain, as subtyping *still* treats the signature differently
* moving part of the typeck logic for methods, autoderef and coercion into `rustc::traits`
* allowing LUB coercions (joining multiple expressions) to "stack up" many adjustments
* transitive coercions (e.g. reify or unsize after multiple steps of autoderef)

r? @nikomatsakis
2017-06-01 11:34:13 +00:00
James Cowgill
edefcb2946 Don't byteswap Fingerprints when encoding
Byteswapping Fingerprints when encoding is unnessesary and breaks if
the Fingerprint is later decoded on a machine with different endianness
to the one it was encoded on. Fix by removing the Encodable and
Decodable implementations and use the ones derived from RustcEncodable
and RustcDecodable.

Fixes #42239
2017-06-01 10:32:11 +01:00
bors
afd4b81c86 Auto merge of #42263 - alexcrichton:fix-copies, r=Mark-Simulacrum
rustbuild: Fix copying duplicate crates into the sysroot

After compiling a project (e.g. libstd, libtest, or librustc) rustbuild needs to
copy over all artifacts into the sysroot of the compiler it's assembling.
Unfortunately rustbuild doesn't know precisely what files to copy! Today it has
a heuristic where it just looks at the most recent version of all files that
look like rlibs/dylibs and copies those over. This unfortunately leads to bugs
with different versions of the same crate as seen in #42261.

This commit updates rustbuild's strategy of copying artifacts to work off the
list of artifacts produced by `cargo build --message-format=json`. The build
system will now parse json messages coming out of Cargo to watch for files being
generated, and then it'll only copy over those precise files.

Note that there's still a bit of weird logic where Cargo prints that it's
creating `libstd.rlib` where we actually want `libstd-xxxxx.rlib`, so we still
do a bit of "most recent file" probing for those. This commit should take care
of the crates.io dependency issues, however, as they're all copied over
precisely.

Closes #42261
2017-06-01 07:44:01 +00:00
Falco Hirschenberger
f83901bb89 Adding support for the llvm prefetch intrinsic
Related to #37251
2017-06-01 08:34:16 +02:00
Eduard-Mihai Burtescu
5fb37beecd tests: fix fallout from changing the span of binop errors. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
58632f3c1c tests: fix fallout from empowering unused_allocation in comparisons. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
3ce443828b rustc: adjust the RHS of comparison operators instead of assuming autorefs. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
194fe695e3 rustc: decompose Adjustment into a vector of adjustment steps. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
91d603a2a7 rustc: move autoref and unsize from Adjust::DerefRef to Adjustment. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
4a754f224d rustc: replace autoderefs' use of MethodCallee with OverloadedDeref. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
c0e8fffcbf rustc: remove unused TypeFolder methods. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
552ab37a10 rustc: replace method_map with Def::Method and node_substs entries. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
9eae6ba7fa rustc: remove unnecessary ItemSubsts wrapper. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
a65ced5d16 rustc: avoid using MethodCallee's signature where possible. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
22510f3266 rustc: replace TyFnDef in MethodCallee with just the FnSig. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
b4988f0792 rustc: keep overloaded autoderef MethodCallee's in Adjust. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
9a53c3e904 rustc: remove unused field of mc::Categorization::Deref. 2017-06-01 08:59:47 +03:00
Eduard-Mihai Burtescu
c6651ffd8e rustc: remove Copy from Adjustment and Adjust. 2017-06-01 08:59:19 +03:00
Scott McMurray
15dff84dc3 Avoid range::step_by in another test 2017-05-31 22:35:35 -07:00
Scott McMurray
1723e063c9 Deprecate iter::range::StepBy
Only exposed as DeprecatedStepBy (as of PR 41439)
2017-05-31 22:35:34 -07:00
Scott McMurray
0967e2495d Deprecate Range*::step_by
Changed all the tests except test_range_step to use Iterator::step_by.
2017-05-31 22:35:34 -07:00
bors
38efb2e1cc Auto merge of #42348 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests

- Successful merges: #42136, #42275, #42286, #42297, #42302, #42306, #42314, #42324, #42347
- Failed merges:
2017-06-01 05:24:11 +00:00
Corey Farwell
9bd6dc73fc Rollup merge of #42347 - frewsxcv:frewsxcv/improve-receiver-recv-timeout-docs, r=QuietMisdreavus
Rewrite doc examples for `Receiver::recv_timeout`.

None
2017-06-01 00:09:27 -04:00
Corey Farwell
9d68a231e6 Rollup merge of #42324 - seanmonstar:41323-compare_const_impl, r=nikomatsakis
associated_consts: check trait obligations and regionck for associated consts

Closes #41323

r? @nikomatsakis
2017-06-01 00:09:25 -04:00
Corey Farwell
a554b74316 Rollup merge of #42314 - jannic:patch-1, r=japaric
ARMv5 needs +strict-align

Without that flag, LLVM generates unaligned memory access instructions, which are not allowed on ARMv5.

For example, the 'hello world' example from `cargo --new` failed with:
```
$ ./hello
Hello, world!
thread 'main' panicked at 'assertion failed: end <= len', src/libcollections/vec.rs:1113
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```

I traced this error back to the following assembler code in `BufWriter::flush_buf`:
```
    6f44:       e28d0018        add     r0, sp, #24
[...]
    6f54:       e280b005        add     fp, r0, #5
[...]
    7018:       e5cd001c        strb    r0, [sp, #28]
    701c:       e1a0082a        lsr     r0, sl, #16
    7020:       03a01001        moveq   r1, #1
    7024:       e5cb0002        strb    r0, [fp, #2]
    7028:       e1cba0b0        strh    sl, [fp]
```

Note that `fp` points to `sp + 29`, so the three `str*`-instructions should fill up a 32bit - value at `sp + 28`, which is later used as the value `n` in `Ok(n) => written += n`. This doesn't work on ARMv5 as the `strh` can't write to the unaligned contents of `fp`, so the upper bits of `n` won't get cleared, leading to the assertion failure in Vec::drain.

With `+strict-align`, the code works as expected.
2017-06-01 00:09:25 -04:00
Corey Farwell
2221f9c6b9 Rollup merge of #42306 - efyang:rls-packaging, r=alexcrichton
Add the RLS to .exe, .msi, and .pkg installers

This directly addresses issue #42157, adding the RLS as a non-default component in the mentioned installers. The windows installers appear to have the right functionality added, but I don't have a machine that runs OSX, so it would be great if someone could test whether my .pkg commit adds the RLS correctly. The final commit also fixes some formatting issues I'd noticed while working on the installers, but I don't know if that's within the scope of this PR, so input would be appreciated.
2017-06-01 00:09:24 -04:00
Corey Farwell
a3b842e191 Rollup merge of #42302 - GuillaumeGomez:new-error-codes-next, r=Susurrus
New error codes next

Part #42229.
To be merged after #42264.

cc @Susurrus
2017-06-01 00:09:23 -04:00
Corey Farwell
b03ed42c36 Rollup merge of #42297 - tschottdorf:proj-ty, r=nikomatsakis
Upgrade ProjectionTy's Name to a DefId

Part of #42171, in preparation for downgrading the contained `TraitRef` to
only its `substs`.

Some inline questions in the diff. Look for `FIXME(tschottdorf)`. These comments
should be addressed before merging.
2017-06-01 00:09:22 -04:00
Corey Farwell
ae75dbfc23 Rollup merge of #42286 - ollie27:rustdoc_assoc_const, r=GuillaumeGomez
rustdoc: Cleanup associated const value rendering

Rather than (ab)using Debug for outputting the type in plain text use the
alternate format parameter which already does exactly that. This fixes
type parameters for example which would output raw HTML.

Also cleans up adding parens around references to trait objects.
2017-06-01 00:09:21 -04:00
Corey Farwell
dbc9d71b17 Rollup merge of #42275 - scottmcm:try-trait, r=nikomatsakis
Lower `?` to `Try` instead of `Carrier`

The easy parts of https://github.com/rust-lang/rfcs/pull/1859, whose FCP completed without further comments.

Just the trait and the lowering -- neither the error message improvements nor the insta-stable impl for Option nor exhaustive docs.

Based on a [github search](https://github.com/search?l=rust&p=1&q=question_mark_carrier&type=Code&utf8=%E2%9C%93), this will break the following:

- 00206e34c6/src/serialize.rs (L38)
- b1325898f4/src/result.rs (L50)

The other results appear to be files from libcore or its tests.  I could also leave Carrier around after stage0 and `impl<T:Carrier> Try for T` if that would be better.

r? @nikomatsakis

Edit: Oh, and it might accidentally improve perf, based on https://github.com/rust-lang/rust/issues/37939#issuecomment-265803670, since `Try::into_result` for `Result` is an obvious no-op, unlike `Carrier::translate`.
2017-06-01 00:09:20 -04:00
Corey Farwell
422faf7a6f Rollup merge of #42136 - petrochenkov:oldhard, r=nikomatsakis
Turn sufficiently old compatibility lints into hard errors

It's been almost 7 months since https://github.com/rust-lang/rust/pull/36894 was merged, so it's time to take the next step.

[breaking-change], needs crater run.

PRs/issues submitted to affected crates:
https://github.com/alexcrichton/ctest/pull/17
https://github.com/Sean1708/rusty-cheddar/pull/55
https://github.com/m-r-r/helianto/pull/3
https://github.com/azdle/virgil/pull/1
https://github.com/rust-locale/rust-locale/issues/24
https://github.com/mneumann/acyclic-network-rs/pull/1
https://github.com/reem/rust-typemap/pull/38

cc https://internals.rust-lang.org/t/moving-forward-on-forward-compatibility-lints/4204
cc https://github.com/rust-lang/rust/issues/34537 https://github.com/rust-lang/rust/issues/36887
Closes https://github.com/rust-lang/rust/issues/36886
Closes https://github.com/rust-lang/rust/issues/36888
Closes https://github.com/rust-lang/rust/issues/36890
Closes https://github.com/rust-lang/rust/issues/36891
Closes https://github.com/rust-lang/rust/issues/36892
r? @nikomatsakis
2017-06-01 00:09:19 -04:00
Corey Farwell
bcd1fe56c7 Rewrite doc examples for Receiver::recv_timeout. 2017-05-31 23:01:55 -04:00