]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAuto merge of #41990 - qnighy:disallow-underscore-suffix-for-string-like-literals...
bors [Tue, 6 Jun 2017 02:56:17 +0000 (02:56 +0000)]
Auto merge of #41990 - qnighy:disallow-underscore-suffix-for-string-like-literals, r=nikomatsakis

Disallow underscore suffix for string-like literals.

This patch turns string/bytestring/char/byte literals followed by an underscore, like `"Foo"_`, to an error.

`scan_optional_raw_name` will parse `_` as a valid raw name, but it will be rejected by the parser. I also considered just stopping parsing when the suffix is `_`, but in that case `"Foo"_` will be lexed as two valid tokens.

Fixes the latter half of #41723.

7 years agoAuto merge of #42452 - raphlinus:mx_job_default, r=alexcrichton
bors [Mon, 5 Jun 2017 21:42:19 +0000 (21:42 +0000)]
Auto merge of #42452 - raphlinus:mx_job_default, r=alexcrichton

[fuchsia] Track change of mx_job_default

The implementation of mx_job_default changed from a macro which
accessed the __magenta_job_default global variable to a proper
function call. This patch tracks that change.

7 years ago[fuchsia] Track change of mx_job_default
Raph Levien [Mon, 5 Jun 2017 18:27:31 +0000 (11:27 -0700)]
[fuchsia] Track change of mx_job_default

The implementation of mx_job_default changed from a macro which
accessed the __magenta_job_default global variable to a proper
function call. This patch tracks that change.

7 years agoAuto merge of #42414 - frewsxcv:frewsxcv/improve-cow-docs, r=QuietMisdreavus
bors [Mon, 5 Jun 2017 15:38:24 +0000 (15:38 +0000)]
Auto merge of #42414 - frewsxcv:frewsxcv/improve-cow-docs, r=QuietMisdreavus

Improve `Cow` method doc examples.

None

7 years agoAuto merge of #42383 - estebank:candidate-newline, r=arielb1
bors [Mon, 5 Jun 2017 13:07:38 +0000 (13:07 +0000)]
Auto merge of #42383 - estebank:candidate-newline, r=arielb1

Use multiline note for trait suggestion

7 years agoAuto merge of #42426 - arthurprs:io_error, r=sfackler
bors [Sun, 4 Jun 2017 23:35:21 +0000 (23:35 +0000)]
Auto merge of #42426 - arthurprs:io_error, r=sfackler

Inline io::Error creation from ErrorKind

Faster and smaller code for mio and tokio (PRs on those to follow)

7 years agoAuto merge of #42362 - estebank:type, r=arielb1
bors [Sun, 4 Jun 2017 20:16:09 +0000 (20:16 +0000)]
Auto merge of #42362 - estebank:type, r=arielb1

Show trait method signature when impl differs

When the trait's span is available, it is already being used, add a
`note` for the cases where the span isn't available:

<pre>
error[E0053]: <b>method `fmt` has an incompatible type for trait</b>
  --> $DIR/trait_type.rs:17:4
   |
17 |    fn fmt(&self, x: &str) -> () { }
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
   |
   = note: expected type `<b>fn(&MyType, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error></b>`
              found type `<b>fn(&MyType, &str)</b>`

error[E0050]: <b>method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2</b>
  --> $DIR/trait_type.rs:21:11
   |
21 |    fn fmt(&self) -> () { }
   |           ^^^^^ expected 2 parameters, found 1
   |
   = note: `fmt` from trait: `<b>fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error></b>`

error[E0186]: <b>method `fmt` has a `&self` declaration in the trait, but not in the impl</b>
  --> $DIR/trait_type.rs:25:4
   |
25 |    fn fmt() -> () { }
   |    ^^^^^^^^^^^^^^^^^^ expected `&self` in impl
   |
   = note: `fmt` from trait: `<b>fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error></b>`

error[E0046]: <b>not all trait items implemented, missing: `fmt`</b>
  --> $DIR/trait_type.rs:28:1
   |
28 | impl std::fmt::Display for MyType4 {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
   |
   = note: `fmt` from trait: `<b>fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error></b>`
</code></pre>

Fix #28011.

7 years agoSeparate suggestion in a `help` and a `note`
Esteban Küber [Sun, 4 Jun 2017 00:06:46 +0000 (17:06 -0700)]
Separate suggestion in a `help` and a `note`

7 years agoShow trait method signature when impl differs
Esteban Küber [Thu, 1 Jun 2017 06:14:43 +0000 (23:14 -0700)]
Show trait method signature when impl differs

When the trait's span is available, it is already being used, add a
`note` for the cases where the span isn't available:

```
error[E0053]: method `fmt` has an incompatible type for trait
  --> $DIR/trait_type.rs:17:4
   |
17 |    fn fmt(&self, x: &str) -> () { }
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
   |
   = note: expected type `fn(&MyType, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
              found type `fn(&MyType, &str)`

error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2
  --> $DIR/trait_type.rs:21:11
   |
21 |    fn fmt(&self) -> () { }
   |           ^^^^^ expected 2 parameters, found 1
   |
   = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`

error[E0186]: method `fmt` has a `&self` declaration in the trait, but not in the impl
  --> $DIR/trait_type.rs:25:4
   |
25 |    fn fmt() -> () { }
   |    ^^^^^^^^^^^^^^^^^^ expected `&self` in impl
   |
   = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`

error[E0046]: not all trait items implemented, missing: `fmt`
  --> $DIR/trait_type.rs:28:1
   |
28 | impl std::fmt::Display for MyType4 {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
   |
   = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
```

7 years agoAuto merge of #42402 - citizen428:create-dump-mir-dir, r=Mark-Simulacrum
bors [Sun, 4 Jun 2017 17:51:46 +0000 (17:51 +0000)]
Auto merge of #42402 - citizen428:create-dump-mir-dir, r=Mark-Simulacrum

Create directory for dump-mir-dir automatically

Fixes #35543 r? @Mark-Simulacrum

@Mark-Simulacrum I know someone else said that they'll work on this, but it has been 3+ weeks and I had nothing to do and wanted to contribute a bit.

I now added the call to automatically create the directory as discussed, but was wondering how you feel about the suggestion to set a default directory, i.e. `target/mir`?

7 years agoinline io::Error creation from ErrorKind
arthurprs [Sun, 4 Jun 2017 17:45:44 +0000 (19:45 +0200)]
inline io::Error creation from ErrorKind

7 years agoAuto merge of #42418 - tomprince:try-deploy, r=Mark-Simulacrum
bors [Sun, 4 Jun 2017 15:35:37 +0000 (15:35 +0000)]
Auto merge of #42418 - tomprince:try-deploy, r=Mark-Simulacrum

Upload linux-x86_64 artifacts on try branch.

This is an experiment to explore generating artifacts for testing with cargobmomb. See brson/cargobomb#64.

7 years agoAuto merge of #42406 - bjorn3:patch-1, r=eddyb
bors [Sun, 4 Jun 2017 12:36:11 +0000 (12:36 +0000)]
Auto merge of #42406 - bjorn3:patch-1, r=eddyb

Some doc comments

7 years agoDon't run travis tests on master.
Mark Simulacrum [Sat, 3 Jun 2017 18:49:03 +0000 (12:49 -0600)]
Don't run travis tests on master.

This saves us builders for more helpful purposes.

7 years agoAuto merge of #42265 - Zoxc:for-sugar, r=eddyb
bors [Sun, 4 Jun 2017 05:44:39 +0000 (05:44 +0000)]
Auto merge of #42265 - Zoxc:for-sugar, r=eddyb

Change for-loop desugar to not borrow the iterator during the loop

This is enables the use of suspend points inside for-loops in movable generators. This is illegal in the current desugaring as `iter` is borrowed across the body.

7 years agoAuto merge of #41968 - kennytm:fix-unreadable-json-test-output-36516, r=nikomatsakis
bors [Sun, 4 Jun 2017 03:23:39 +0000 (03:23 +0000)]
Auto merge of #41968 - kennytm:fix-unreadable-json-test-output-36516, r=nikomatsakis

Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516.

<del>`ui-run` test is a combination of `ui` test and `run-pass` test. It is used to test lint output.</del>

Added support of `// run-pass` header to `ui` tests.

The compiler message of each test must match the corresponding `*.stderr` file like the traditional `ui` tests. Additionally, the compiled output must be executed successfully like the `run-pass` test.

12 `run-pass`/`run-pass-fulldeps` tests are moved to `ui`/`ui-fulldeps` plus the headers. After this move, no `run-pass`/`run-pass-fulldeps` tests should rely on the compiler's JSON message. This allows us to stop passing `--error-format json` in run-pass tests, thus fixing #36516.

7 years agoCreate directory for dump-mir-dir automatically
Michael Kohl [Sat, 3 Jun 2017 07:38:45 +0000 (14:38 +0700)]
Create directory for dump-mir-dir automatically

Fixes #35543

7 years agoDeploy linux-x86_64 artifacts on try branch.
Tom Prince [Sun, 4 Jun 2017 01:06:22 +0000 (19:06 -0600)]
Deploy linux-x86_64 artifacts on try branch.

7 years agoAuto merge of #42398 - redox-os:master, r=sfackler
bors [Sun, 4 Jun 2017 01:06:23 +0000 (01:06 +0000)]
Auto merge of #42398 - redox-os:master, r=sfackler

Redox: Switch to repr(C) for syscall structs

7 years agoAuto merge of #42391 - photoszzt:master, r=Manishearth
bors [Sat, 3 Jun 2017 22:49:11 +0000 (22:49 +0000)]
Auto merge of #42391 - photoszzt:master, r=Manishearth

Better suggestion for unknown method

r? @Manishearth

fixes #42386

7 years agoAuto merge of #42387 - GuillaumeGomez:error-codes-next, r=Susurrus
bors [Sat, 3 Jun 2017 20:31:11 +0000 (20:31 +0000)]
Auto merge of #42387 - GuillaumeGomez:error-codes-next, r=Susurrus

Add E0603 error code

Part of #42229.

cc @Susurrus

7 years ago Improve doc example for `Cow::to_mut`.
Corey Farwell [Sat, 3 Jun 2017 18:54:17 +0000 (14:54 -0400)]
 Improve doc example for `Cow::to_mut`.

7 years agoImprove doc examples for `Cow::into_owned`.
Corey Farwell [Sat, 3 Jun 2017 18:40:23 +0000 (14:40 -0400)]
Improve doc examples for `Cow::into_owned`.

7 years agoAuto merge of #42369 - RalfJung:drop-glue, r=eddyb
bors [Sat, 3 Jun 2017 18:02:57 +0000 (18:02 +0000)]
Auto merge of #42369 - RalfJung:drop-glue, r=eddyb

array drop glue: avoid using out-of-bounds index lvalues

Avoid using out-of-bounds index lvalues. Miri doesn't like them, and they seem fishy in general.
Instead, use a pointer cast to compute the address of the beginning, and Offset to compute the end.

Cc @arielb1 @nagisa

7 years agoModule doc comment for librustc/dep_graph/safe.rs
bjorn3 [Sat, 3 Jun 2017 16:04:37 +0000 (18:04 +0200)]
Module doc comment for librustc/dep_graph/safe.rs

7 years agoMake some comments docs in librustc/dep_graph/dep_node.rs
bjorn3 [Sat, 3 Jun 2017 15:59:07 +0000 (17:59 +0200)]
Make some comments docs in librustc/dep_graph/dep_node.rs

7 years agoAuto merge of #42334 - est31:master, r=jseyfried
bors [Sat, 3 Jun 2017 15:40:34 +0000 (15:40 +0000)]
Auto merge of #42334 - est31:master, r=jseyfried

Extend the unused macro lint to macros 2.0

Extends the unused macro lint (added in PR #41907) to macros 2.0 (added in PR #40847).

r? @jseyfried

7 years agoAuto merge of #42396 - venkatagiri:remove_lifetime_extn, r=arielb1
bors [Sat, 3 Jun 2017 13:17:20 +0000 (13:17 +0000)]
Auto merge of #42396 - venkatagiri:remove_lifetime_extn, r=arielb1

rustc: remove temporary lifetime extension by borrow hint

closes #39283.

Thanks to @nikomatsakis for mentoring on this one.

r? @arielb1

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 agoSwitch to repr(C) for syscall structs
Jeremy Soller [Sat, 3 Jun 2017 02:30:20 +0000 (20:30 -0600)]
Switch to repr(C) for syscall structs

7 years agoBetter suggestion for unknown method
zzhu [Fri, 2 Jun 2017 20:20:36 +0000 (13:20 -0700)]
Better suggestion for unknown method

Fixes #42386

7 years agorustc: remove temporary lifetime extension by borrow hint
Venkata Giri Reddy [Fri, 2 Jun 2017 23:43:50 +0000 (23:43 +0000)]
rustc: remove temporary lifetime extension by borrow hint

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 agoAdd E0603 error code
Guillaume Gomez [Fri, 2 Jun 2017 19:38:52 +0000 (21:38 +0200)]
Add E0603 error code

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 agoUse multiline note for trait suggestion
Esteban Küber [Fri, 2 Jun 2017 17:15:13 +0000 (10:15 -0700)]
Use multiline note for trait suggestion

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 agocompiletest: Force directive to be first complete word in header comment.
kennytm [Wed, 24 May 2017 08:11:32 +0000 (16:11 +0800)]
compiletest: Force directive to be first complete word in header comment.

Refactored some related code to take advantage of this change.

7 years agoIntroduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516.
kennytm [Sat, 13 May 2017 09:54:50 +0000 (17:54 +0800)]
Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516.

The 'run-pass' header cause a 'ui' test to execute the result. It is used
to test the lint output, at the same time ensure those lints won't cause
the source code to become compile-fail.

12 run-pass/run-pass-fulldeps tests gained the header and are moved to
ui/ui-fulldeps. After this move, no run-pass/run-pass-fulldeps tests should
rely on the compiler's JSON message. This allows us to stop passing
`--error-format json` in run-pass tests, thus fixing #36516.

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 agoarray drop glue: avoid using out-of-bounds index lvalues
Ralf Jung [Thu, 1 Jun 2017 23:55:59 +0000 (16:55 -0700)]
array drop glue: avoid using out-of-bounds index lvalues

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 agoChange for-loop desugar to not borrow the iterator during the loop
John Kåre Alsaker [Sat, 27 May 2017 18:20:17 +0000 (20:20 +0200)]
Change for-loop desugar to not borrow the iterator during the loop

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.