]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAuto merge of #42332 - michaelwoerister:no-more-retracing, r=nikomatsakis
bors [Sat, 3 Jun 2017 10:56:42 +0000 (10:56 +0000)]
Auto merge of #42332 - michaelwoerister:no-more-retracing, r=nikomatsakis

incr.comp.: Use DefPathHash-based DepNodes in the serialized DepGraph and remove obsolete DefIdDirectory

With this PR we don't store the dep-graph as a set of `DepNode<IndexIntoDefIdDirectory>` anymore but instead as a set of `DepNode<DefPathHash>`. Since a `DefPathHash` is a global identifier that is valid across compilation sessions, we don't need the `DefIdDirectory` anymore.

Since a `DepNode<DefPathHash>` is bigger than a `DepNode<IndexIntoDefIdDirectory>` and our on-disk encoding of the dep-graph is inefficient, this PR will probably increase the amount of space the dep-graph takes up on disk. I'm in the process of gathering some performance data.

The changes in here are a step towards implementing ICH-based `DepNodes` (#42294).

r? @nikomatsakis

7 years agoAuto merge of #42331 - retep998:standard-relocation-coupon, r=alexcrichton
bors [Sat, 3 Jun 2017 08:32:58 +0000 (08:32 +0000)]
Auto merge of #42331 - retep998:standard-relocation-coupon, r=alexcrichton

Improve reallocation in alloc_system on Windows

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

7 years agoAuto merge of #42400 - frewsxcv:rollup, r=frewsxcv
bors [Sat, 3 Jun 2017 06:13:05 +0000 (06:13 +0000)]
Auto merge of #42400 - frewsxcv:rollup, r=frewsxcv

Rollup of 5 pull requests

- Successful merges: #42353, #42354, #42363, #42368, #42382
- Failed merges:

7 years agoRollup merge of #42382 - alexcrichton:remove-rustflags, r=Mark-Simulacrum
Corey Farwell [Sat, 3 Jun 2017 05:00:55 +0000 (01:00 -0400)]
Rollup merge of #42382 - alexcrichton:remove-rustflags, r=Mark-Simulacrum

rustbuild: Remove RUSTFLAGS logic in rustc shim

This was added in #38072 but I can't recall why and AFAIK Cargo already handles
this. This was discovered through #42146 where passing duplicate flags was
causing problems.

7 years agoRollup merge of #42368 - estebank:call-site, r=nikomatsakis
Corey Farwell [Sat, 3 Jun 2017 05:00:54 +0000 (01:00 -0400)]
Rollup merge of #42368 - estebank:call-site, r=nikomatsakis

Use callsite's span for macro calls on suggestion

When suggesting an appropriate mutability for a macro call, use the call
span instead of the expanded macro's span.

```
error[E0308]: mismatched types
  --> $DIR/coerce-suggestions.rs:48:9
   |
48 |     s = format!("foo");
   |         ^^^^^^^^^^^^^^ expected mutable reference, found struct `std::string::String`
   |
   = note: expected type `&mut std::string::String`
              found type `std::string::String`
   = help: try with `&mut format!("foo")`
   = note: this error originates in a macro outside of the current crate
```
Fix #41858.

7 years agoRollup merge of #42363 - cuviper:no-fail-fast, r=alexcrichton
Corey Farwell [Sat, 3 Jun 2017 05:00:53 +0000 (01:00 -0400)]
Rollup merge of #42363 - cuviper:no-fail-fast, r=alexcrichton

rustbuild: Add `./x.py test --no-fail-fast`

This option forwards to each `cargo test` invocation, and applies the
same logic across all test steps to keep going after failures.  At the
end, a brief summary line reports how many commands failed, if any.

Note that if a test program fails to even start at all, or if an
auxiliary build command related to testing fails, these are still left
to stop everything right away.

Fixes #40219.

7 years agoRollup merge of #42354 - Mark-Simulacrum:reduce-verbosity, r=alexcrichton
Corey Farwell [Sat, 3 Jun 2017 05:00:52 +0000 (01:00 -0400)]
Rollup merge of #42354 - Mark-Simulacrum:reduce-verbosity, r=alexcrichton

Reduce verbosity of build logs

This does two separate things.
 - Sets sccache logging to warn instead of info.
 - Makes tests when running for a given PR (not on auto branch) quiet. (cc @eddyb)

r? @alexcrichton

7 years agoRollup merge of #42353 - steveklabnik:update-books, r=GuillaumeGomez
Corey Farwell [Sat, 3 Jun 2017 05:00:51 +0000 (01:00 -0400)]
Rollup merge of #42353 - steveklabnik:update-books, r=GuillaumeGomez

Update various book repos for the next release.

7 years agoAuto merge of #41953 - Aaronepower:patch-1, r=brson
bors [Sat, 3 Jun 2017 03:57:13 +0000 (03:57 +0000)]
Auto merge of #41953 - Aaronepower:patch-1, r=brson

Updated releases notes for 1.18

This is my first time making the release notes so please give it an extra once over!

7 years agoAuto merge of #42381 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Fri, 2 Jun 2017 22:19:08 +0000 (22:19 +0000)]
Auto merge of #42381 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 10 pull requests

- Successful merges: #41981, #42225, #42310, #42319, #42335, #42343, #42355, #42360, #42370, #42372
- Failed merges:

7 years agoAuto merge of #42189 - nikomatsakis:chalk-trait-env-param-env, r=eddyb
bors [Fri, 2 Jun 2017 19:23:14 +0000 (19:23 +0000)]
Auto merge of #42189 - nikomatsakis:chalk-trait-env-param-env, r=eddyb

querify layout and move param env out of the infcx

The main goal of this PR is to move the parameter environment *out* of the inference context. This is because the inference environment will soon be changing over the course of inference --- for example, when we enter into a `for<'a> fn(...)` type, we will push a new environment with an increasing universe index, rather than skolemizing the `'a` references. Similarly, each obligation will soon be able to have a distinct parameter environment, and therefore the `Obligation` struct is extended to carry a `ParamEnv<'tcx>`. (I debated about putting it into the cause; seems plausible, but also weird.)

Along the way, I also reworked how layout works, moving the layout cache into a proper query along the lines of needs-drop and friends.

Finally, tweaks the inference context API. It seemed to be accumulating parameters at an alarming rate. The main way to e.g. make a subtype or equality relationship is to do the following:

    infcx.at(cause, param_env).sub(a, b)
    infcx.at(cause, param_env).eq(a, b)

In both cases, `a` is considered the "expected" type (this used to be specified by a boolean). I tried hard to preserve the existing notion of what was "expected", although in some cases I'm not convinced it was being set on purpose one way or the other. This is why in some cases you will see me do `sup(b, a)`, which is otherwise equivalent to `sub(a, b)`, but sets the "expected type" differently.

r? @eddyb
cc @arielb1

7 years agoQuiet tests on PR tests
Mark Simulacrum [Thu, 1 Jun 2017 15:48:48 +0000 (09:48 -0600)]
Quiet tests on PR tests

7 years agoReduce sccache log level.
Mark Simulacrum [Thu, 1 Jun 2017 15:45:33 +0000 (09:45 -0600)]
Reduce sccache log level.

7 years agorustbuild: Remove RUSTFLAGS logic in rustc shim
Alex Crichton [Fri, 2 Jun 2017 16:57:20 +0000 (09:57 -0700)]
rustbuild: Remove RUSTFLAGS logic in rustc shim

This was added in #38072 but I can't recall why and AFAIK Cargo already handles
this. This was discovered through #42146 where passing duplicate flags was
causing problems.

7 years agorustbuild: Add `./x.py test --no-fail-fast`
Josh Stone [Fri, 2 Jun 2017 16:27:44 +0000 (09:27 -0700)]
rustbuild: Add `./x.py test --no-fail-fast`

This option forwards to each `cargo test` invocation, and applies the
same logic across all test steps to keep going after failures.  At the
end, a brief summary line reports how many commands failed, if any.

Note that if a test program fails to even start at all, or if an
auxiliary build command related to testing fails, these are still left
to stop everything right away.

Fixes #40219.

7 years agoRollup merge of #42372 - frewsxcv:frewsxcv/improve-receiver-docs, r=QuietMisdreavus
Mark Simulacrum [Fri, 2 Jun 2017 15:10:49 +0000 (09:10 -0600)]
Rollup merge of #42372 - frewsxcv:frewsxcv/improve-receiver-docs, r=QuietMisdreavus

Rewrite a couple `Receiver` doc examples.

None

7 years agoRollup merge of #42370 - mbrubeck:docs, r=frewsxcv
Mark Simulacrum [Fri, 2 Jun 2017 15:10:48 +0000 (09:10 -0600)]
Rollup merge of #42370 - mbrubeck:docs, r=frewsxcv

Add [[T]] -> [T] examples to SliceConcatExt docs

None

7 years agoRollup merge of #42360 - ollie27:rustdoc_vector_rename, r=GuillaumeGomez
Mark Simulacrum [Fri, 2 Jun 2017 15:10:47 +0000 (09:10 -0600)]
Rollup merge of #42360 - ollie27:rustdoc_vector_rename, r=GuillaumeGomez

rustdoc: Rename `Vector` and `FixedVector` to `Slice` and `Array`

Also store the array length as a usize rather than a String.

This is just a minor refactor.

7 years agoRollup merge of #42355 - bjorn3:patch-1, r=Mark-Simulacrum
Mark Simulacrum [Fri, 2 Jun 2017 15:10:46 +0000 (09:10 -0600)]
Rollup merge of #42355 - bjorn3:patch-1, r=Mark-Simulacrum

Syntax highlight rust code in librustc/dep_graph/README.md

7 years agoRollup merge of #42343 - cuviper:install-executables, r=alexcrichton
Mark Simulacrum [Fri, 2 Jun 2017 15:10:45 +0000 (09:10 -0600)]
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

7 years agoRollup merge of #42335 - jcowgill:fingerprint-be, r=michaelwoerister
Mark Simulacrum [Fri, 2 Jun 2017 15:10:44 +0000 (09:10 -0600)]
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

7 years agoRollup merge of #42319 - Manishearth:const-extern, r=nikomatsakis
Mark Simulacrum [Fri, 2 Jun 2017 15:10:43 +0000 (09:10 -0600)]
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.

7 years agoRollup merge of #42310 - scottmcm:deprecate-range-stepby, r=alexcrichton
Mark Simulacrum [Fri, 2 Jun 2017 15:10:42 +0000 (09:10 -0600)]
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

7 years agoRollup merge of #42225 - brson:vs2017, r=alexcrichton
Mark Simulacrum [Fri, 2 Jun 2017 15:10:42 +0000 (09:10 -0600)]
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

7 years agoRollup merge of #41981 - gamazeps:thread-detach, r=frewsxcv
Mark Simulacrum [Fri, 2 Jun 2017 15:10:41 +0000 (09:10 -0600)]
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

7 years agoAuto merge of #42128 - kennytm:travis-folder, r=alexcrichton
bors [Fri, 2 Jun 2017 12:14:14 +0000 (12:14 +0000)]
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.

7 years agoAdd test for vecs with overaligned data
Peter Atashian [Thu, 1 Jun 2017 03:24:19 +0000 (23:24 -0400)]
Add test for vecs with overaligned data

7 years agoImprove reallocation in alloc_system on Windows
Peter Atashian [Wed, 31 May 2017 12:27:02 +0000 (08:27 -0400)]
Improve reallocation in alloc_system on Windows

7 years agoExpands `detach` documentation in `thread::JoinHande`.
Felix Raimundo [Sat, 13 May 2017 19:19:13 +0000 (21:19 +0200)]
Expands `detach` documentation in `thread::JoinHande`.

Part of #29378 .

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

7 years agoAuto merge of #41670 - scottmcm:slice-rotate, r=alexcrichton
bors [Fri, 2 Jun 2017 07:51:20 +0000 (07:51 +0000)]
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

7 years agoAuto merge of #41418 - hirschenberger:prefetch-intrinsic, r=nagisa
bors [Fri, 2 Jun 2017 04:58:09 +0000 (04:58 +0000)]
Auto merge of #41418 - hirschenberger:prefetch-intrinsic, r=nagisa

Adding support for the llvm `prefetch` intrinsic

Optimize `slice::binary_search` by using prefetching.

7 years agoRewrite `Receiver::try_iter` doc example to show resulting values.
Corey Farwell [Fri, 2 Jun 2017 04:20:25 +0000 (00:20 -0400)]
Rewrite `Receiver::try_iter` doc example to show resulting values.

7 years agoRewrite `Receiver::iter` doc example to show resulting values.
Corey Farwell [Fri, 2 Jun 2017 04:18:53 +0000 (00:18 -0400)]
Rewrite `Receiver::iter` doc example to show resulting values.

7 years agoUpdate various book repos for the next release.
steveklabnik [Thu, 1 Jun 2017 14:57:17 +0000 (10:57 -0400)]
Update various book repos for the next release.

7 years agoAdd [[T]] -> [T] examples to SliceConcatExt docs
Matt Brubeck [Fri, 2 Jun 2017 00:26:52 +0000 (17:26 -0700)]
Add [[T]] -> [T] examples to SliceConcatExt docs

7 years agoSupport VS 2017
Brian Anderson [Wed, 24 May 2017 02:02:23 +0000 (19:02 -0700)]
Support VS 2017

Fixes #38584

7 years agofix ui reference
Niko Matsakis [Fri, 26 May 2017 23:20:54 +0000 (19:20 -0400)]
fix ui reference

7 years agofix librustc_driver tests
Niko Matsakis [Wed, 24 May 2017 20:15:04 +0000 (16:15 -0400)]
fix librustc_driver tests

7 years agopacify the mercilous tidy
Niko Matsakis [Wed, 24 May 2017 16:01:53 +0000 (12:01 -0400)]
pacify the mercilous tidy

7 years agoergonomic improvements to the methods in infcx
Niko Matsakis [Wed, 24 May 2017 13:43:20 +0000 (09:43 -0400)]
ergonomic improvements to the methods in infcx

7 years agoremove `layout_cache` and fix `-Z print-type-sizes`
Niko Matsakis [Mon, 22 May 2017 18:20:12 +0000 (14:20 -0400)]
remove `layout_cache` and fix `-Z print-type-sizes`

now we grow the type-sizes info during execution, rather than walking
the cache after the fact

7 years agostrip param-env from infcx
Niko Matsakis [Tue, 23 May 2017 08:19:47 +0000 (04:19 -0400)]
strip param-env from infcx

7 years agoUpdated releases notes for 1.18
Aaron Power [Fri, 12 May 2017 14:39:19 +0000 (15:39 +0100)]
Updated releases notes for 1.18

7 years agoci: Further tone down the test verbosity.
kennytm [Sun, 21 May 2017 20:27:47 +0000 (04:27 +0800)]
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.

7 years agoChange .travis.yml's `language: minimal` to `generic`.
kennytm [Sun, 21 May 2017 11:29:42 +0000 (19:29 +0800)]
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.

7 years agoci: Improve log output (mainly Travis).
kennytm [Wed, 17 May 2017 16:33:20 +0000 (00:33 +0800)]
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.

7 years agoAdded --color flag to compiletest.
kennytm [Sat, 20 May 2017 16:35:53 +0000 (00:35 +0800)]
Added --color flag to compiletest.

7 years agoIgnore some folders.
kennytm [Fri, 19 May 2017 14:56:18 +0000 (22:56 +0800)]
Ignore some folders.

- /src/target -- created when trying to directly `cargo build` on a single
  package.

7 years agorewrite layout to take a (param-env, ty) pair instead of infcx
Niko Matsakis [Fri, 19 May 2017 21:27:25 +0000 (17:27 -0400)]
rewrite layout to take a (param-env, ty) pair instead of infcx

7 years agomove projection mode into parameter environment
Niko Matsakis [Wed, 17 May 2017 12:01:04 +0000 (08:01 -0400)]
move projection mode into parameter environment

7 years agoSyntax highlight rust code in librustc/dep_graph/README.md
bjorn3 [Thu, 1 Jun 2017 16:44:20 +0000 (18:44 +0200)]
Syntax highlight rust code in librustc/dep_graph/README.md

7 years agoincr.comp.: Use a more efficient encoding for the on-disk dependency graph.
Michael Woerister [Thu, 1 Jun 2017 13:23:21 +0000 (15:23 +0200)]
incr.comp.: Use a more efficient encoding for the on-disk dependency graph.

7 years agorustdoc: Rename `Vector` and `FixedVector` to `Slice` and `Array`
Oliver Middleton [Wed, 31 May 2017 13:39:30 +0000 (14:39 +0100)]
rustdoc: Rename `Vector` and `FixedVector` to `Slice` and `Array`

Also store the array length as a usize rather than a String.

This is just a minor refactor.

7 years agoAuto merge of #42281 - eddyb:well-adjusted, r=nikomatsakis
bors [Thu, 1 Jun 2017 11:34:13 +0000 (11:34 +0000)]
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

7 years agoDon't byteswap Fingerprints when encoding
James Cowgill [Wed, 31 May 2017 14:53:35 +0000 (15:53 +0100)]
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

7 years agoAuto merge of #42263 - alexcrichton:fix-copies, r=Mark-Simulacrum
bors [Thu, 1 Jun 2017 07:44:01 +0000 (07:44 +0000)]
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

7 years agoUse callsite's span for macro calls on suggestion
Esteban Küber [Thu, 1 Jun 2017 06:48:19 +0000 (23:48 -0700)]
Use callsite's span for macro calls on suggestion

When suggesting an appropriate mutability for a macro call, use the call
span instead of the expanded macro's span.

7 years agoAdding support for the llvm `prefetch` intrinsic
Falco Hirschenberger [Fri, 21 Apr 2017 07:00:34 +0000 (09:00 +0200)]
Adding support for the llvm `prefetch` intrinsic

Related to #37251

7 years agotests: fix fallout from changing the span of binop errors.
Eduard-Mihai Burtescu [Mon, 29 May 2017 11:55:54 +0000 (14:55 +0300)]
tests: fix fallout from changing the span of binop errors.

7 years agotests: fix fallout from empowering unused_allocation in comparisons.
Eduard-Mihai Burtescu [Sun, 28 May 2017 15:24:53 +0000 (18:24 +0300)]
tests: fix fallout from empowering unused_allocation in comparisons.

7 years agorustc: adjust the RHS of comparison operators instead of assuming autorefs.
Eduard-Mihai Burtescu [Sun, 28 May 2017 12:04:13 +0000 (15:04 +0300)]
rustc: adjust the RHS of comparison operators instead of assuming autorefs.

7 years agorustc: decompose Adjustment into a vector of adjustment steps.
Eduard-Mihai Burtescu [Sat, 27 May 2017 07:29:24 +0000 (10:29 +0300)]
rustc: decompose Adjustment into a vector of adjustment steps.

7 years agorustc: move autoref and unsize from Adjust::DerefRef to Adjustment.
Eduard-Mihai Burtescu [Sat, 20 May 2017 20:52:52 +0000 (23:52 +0300)]
rustc: move autoref and unsize from Adjust::DerefRef to Adjustment.

7 years agorustc: replace autoderefs' use of MethodCallee with OverloadedDeref.
Eduard-Mihai Burtescu [Sat, 20 May 2017 17:03:04 +0000 (20:03 +0300)]
rustc: replace autoderefs' use of MethodCallee with OverloadedDeref.

7 years agorustc: remove unused TypeFolder methods.
Eduard-Mihai Burtescu [Sat, 20 May 2017 14:52:05 +0000 (17:52 +0300)]
rustc: remove unused TypeFolder methods.

7 years agorustc: replace method_map with Def::Method and node_substs entries.
Eduard-Mihai Burtescu [Sat, 20 May 2017 13:11:07 +0000 (16:11 +0300)]
rustc: replace method_map with Def::Method and node_substs entries.

7 years agorustc: remove unnecessary ItemSubsts wrapper.
Eduard-Mihai Burtescu [Sat, 20 May 2017 07:26:08 +0000 (10:26 +0300)]
rustc: remove unnecessary ItemSubsts wrapper.

7 years agorustc: avoid using MethodCallee's signature where possible.
Eduard-Mihai Burtescu [Fri, 19 May 2017 09:46:34 +0000 (12:46 +0300)]
rustc: avoid using MethodCallee's signature where possible.

7 years agorustc: replace TyFnDef in MethodCallee with just the FnSig.
Eduard-Mihai Burtescu [Wed, 17 May 2017 19:51:18 +0000 (22:51 +0300)]
rustc: replace TyFnDef in MethodCallee with just the FnSig.

7 years agorustc: keep overloaded autoderef MethodCallee's in Adjust.
Eduard-Mihai Burtescu [Tue, 16 May 2017 21:54:04 +0000 (00:54 +0300)]
rustc: keep overloaded autoderef MethodCallee's in Adjust.

7 years agorustc: remove unused field of mc::Categorization::Deref.
Eduard-Mihai Burtescu [Tue, 16 May 2017 14:54:03 +0000 (17:54 +0300)]
rustc: remove unused field of mc::Categorization::Deref.

7 years agorustc: remove Copy from Adjustment and Adjust.
Eduard-Mihai Burtescu [Tue, 16 May 2017 09:03:09 +0000 (12:03 +0300)]
rustc: remove Copy from Adjustment and Adjust.

7 years agoAvoid range::step_by in another test
Scott McMurray [Tue, 30 May 2017 15:40:50 +0000 (08:40 -0700)]
Avoid range::step_by in another test

7 years agoDeprecate iter::range::StepBy
Scott McMurray [Tue, 30 May 2017 06:56:37 +0000 (23:56 -0700)]
Deprecate iter::range::StepBy

Only exposed as DeprecatedStepBy (as of PR 41439)

7 years agoDeprecate Range*::step_by
Scott McMurray [Tue, 23 May 2017 07:59:25 +0000 (00:59 -0700)]
Deprecate Range*::step_by

Changed all the tests except test_range_step to use Iterator::step_by.

7 years agoAuto merge of #42348 - frewsxcv:rollup, r=frewsxcv
bors [Thu, 1 Jun 2017 05:24:11 +0000 (05:24 +0000)]
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:

7 years agoRollup merge of #42347 - frewsxcv:frewsxcv/improve-receiver-recv-timeout-docs, r...
Corey Farwell [Thu, 1 Jun 2017 04:09:27 +0000 (00:09 -0400)]
Rollup merge of #42347 - frewsxcv:frewsxcv/improve-receiver-recv-timeout-docs, r=QuietMisdreavus

Rewrite doc examples for `Receiver::recv_timeout`.

None

7 years agoRollup merge of #42324 - seanmonstar:41323-compare_const_impl, r=nikomatsakis
Corey Farwell [Thu, 1 Jun 2017 04:09:25 +0000 (00:09 -0400)]
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

7 years agoRollup merge of #42314 - jannic:patch-1, r=japaric
Corey Farwell [Thu, 1 Jun 2017 04:09:25 +0000 (00:09 -0400)]
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.

7 years agoRollup merge of #42306 - efyang:rls-packaging, r=alexcrichton
Corey Farwell [Thu, 1 Jun 2017 04:09:24 +0000 (00:09 -0400)]
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.

7 years agoRollup merge of #42302 - GuillaumeGomez:new-error-codes-next, r=Susurrus
Corey Farwell [Thu, 1 Jun 2017 04:09:23 +0000 (00:09 -0400)]
Rollup merge of #42302 - GuillaumeGomez:new-error-codes-next, r=Susurrus

New error codes next

Part #42229.
To be merged after #42264.

cc @Susurrus

7 years agoRollup merge of #42297 - tschottdorf:proj-ty, r=nikomatsakis
Corey Farwell [Thu, 1 Jun 2017 04:09:22 +0000 (00:09 -0400)]
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.

7 years agoRollup merge of #42286 - ollie27:rustdoc_assoc_const, r=GuillaumeGomez
Corey Farwell [Thu, 1 Jun 2017 04:09:21 +0000 (00:09 -0400)]
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.

7 years agoRollup merge of #42275 - scottmcm:try-trait, r=nikomatsakis
Corey Farwell [Thu, 1 Jun 2017 04:09:20 +0000 (00:09 -0400)]
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:

- https://github.com/pfpacket/rust-9p/blob/00206e34c680198a0ac7c2f066cc2954187d4fac/src/serialize.rs#L38
- https://github.com/peterdelevoryas/bufparse/blob/b1325898f4fc2c67658049196c12da82548af350/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`.

7 years agoRollup merge of #42136 - petrochenkov:oldhard, r=nikomatsakis
Corey Farwell [Thu, 1 Jun 2017 04:09:19 +0000 (00:09 -0400)]
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

7 years agoRewrite doc examples for `Receiver::recv_timeout`.
Corey Farwell [Thu, 1 Jun 2017 03:01:55 +0000 (23:01 -0400)]
Rewrite doc examples for `Receiver::recv_timeout`.

7 years agoUpdate rust-installer for Windows executable mode
Josh Stone [Thu, 1 Jun 2017 00:21:00 +0000 (17:21 -0700)]
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

7 years agoAuto merge of #42336 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Wed, 31 May 2017 21:14:02 +0000 (21:14 +0000)]
Auto merge of #42336 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 7 pull requests

- Successful merges: #42126, #42196, #42252, #42277, #42315, #42329, #42330
- Failed merges:

7 years agorustdoc: Cleanup associated const value rendering
Oliver Middleton [Wed, 31 May 2017 17:02:35 +0000 (18:02 +0100)]
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.

7 years agoImprove error message for const extern fn
Manish Goregaokar [Tue, 30 May 2017 21:23:02 +0000 (14:23 -0700)]
Improve error message for const extern fn

7 years agoRollup merge of #42330 - qnighy:macro-named-default, r=petrochenkov
Mark Simulacrum [Wed, 31 May 2017 16:52:50 +0000 (10:52 -0600)]
Rollup merge of #42330 - qnighy:macro-named-default, r=petrochenkov

Parse macros named "default" correctly.

Fixes #42292.

7 years agoRollup merge of #42329 - rap2hpoutre:patch-6, r=steveklabnik
Mark Simulacrum [Wed, 31 May 2017 16:52:49 +0000 (10:52 -0600)]
Rollup merge of #42329 - rap2hpoutre:patch-6, r=steveklabnik

fix links to "module-level documentation"

see https://github.com/rust-lang/rust/issues/42267

7 years agoRollup merge of #42315 - scottmcm:rangefrom-sizehint, r=alexcrichton
Mark Simulacrum [Wed, 31 May 2017 16:52:48 +0000 (10:52 -0600)]
Rollup merge of #42315 - scottmcm:rangefrom-sizehint, r=alexcrichton

RangeFrom should have an infinite size_hint

Before,
```rust
(0..).take(4).size_hint() == (0, Some(4))
```

With this change,
```rust
(0..).take(4).size_hint() == (4, Some(4))
```

7 years agoRollup merge of #42277 - citizen428:remove-crate-type-metadata, r=nikomatsakis
Mark Simulacrum [Wed, 31 May 2017 16:52:47 +0000 (10:52 -0600)]
Rollup merge of #42277 - citizen428:remove-crate-type-metadata, r=nikomatsakis

Remove --crate-type=metadata deprecation warning

Fixes #38640

7 years agoRollup merge of #42252 - stjepang:clarify-alignof-docs, r=nikomatsakis
Mark Simulacrum [Wed, 31 May 2017 16:52:46 +0000 (10:52 -0600)]
Rollup merge of #42252 - stjepang:clarify-alignof-docs, r=nikomatsakis

Clarify the docs for align_of and its variants

It's okay to have unaligned raw pointers and then use `ptr::write_unaligned` and `ptr::read_unaligned`.
However, using unaligned `&T` and `&mut T` would be undefined behavior.

The current documentation seems to indicate that everything has to be aligned, but in reality only references do. This PR changes the text of docs accordingly.

r? @sfackler

7 years agoRollup merge of #42196 - tommyip:explain_closure_err, r=nikomatsakis
Mark Simulacrum [Wed, 31 May 2017 16:52:45 +0000 (10:52 -0600)]
Rollup merge of #42196 - tommyip:explain_closure_err, r=nikomatsakis

Explain why a closure is `FnOnce` in closure errors.

Issue: #42065
@nikomatsakis Am I going the right direction with this?

~~I am stuck in a few bits:~~
~~1. How to trace the code to get the upvar instead of the original variable's span?~~
~~2. How to find the node id of the upvar where the move occured?~~

7 years agoRollup merge of #42126 - clarcharr:into_docs, r=steveklabnik
Mark Simulacrum [Wed, 31 May 2017 16:52:44 +0000 (10:52 -0600)]
Rollup merge of #42126 - clarcharr:into_docs, r=steveklabnik

Clarify docs on implementing Into.

This was suggested by @dtolnay in #40380.

This explicitly clarifies in what circumstances you should implement `Into` instead of `From`.

7 years agoUpgrade ProjectionTy's Name to a DefId
Tobias Schottdorf [Wed, 31 May 2017 16:35:13 +0000 (12:35 -0400)]
Upgrade ProjectionTy's Name to a DefId

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

7 years agoincr.comp.: Use DefPathHash-based DepNodes in the serialized DepGraph and remove...
Michael Woerister [Wed, 31 May 2017 14:42:52 +0000 (16:42 +0200)]
incr.comp.: Use DefPathHash-based DepNodes in the serialized DepGraph and remove obsolete DefIdDirectory.

7 years agoEmit proper expectation for the "default" keyword.
Masaki Hara [Wed, 31 May 2017 14:22:33 +0000 (23:22 +0900)]
Emit proper expectation for the "default" keyword.