]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoAuto merge of #42850 - estebank:unwanted-return-rotj, r=nikomatsakis
bors [Wed, 28 Jun 2017 20:16:13 +0000 (20:16 +0000)]
Auto merge of #42850 - estebank:unwanted-return-rotj, r=nikomatsakis

Detect missing `;` on methods with return type `()`

 - Point out the origin of a type requirement when it is the return type
   of a method
 - Point out possibly missing semicolon when the return type is `()` and
   the implicit return makes sense as a statement
 - Suggest changing the return type of methods with default return type
 - Don't suggest changing the return type on `fn main()`
 - Don't suggest changing the return type on impl fn
 - Suggest removal of semicolon (instead of being help)

7 years agoAuto merge of #42819 - scottmcm:swap-nonoverlapping, r=sfackler
bors [Wed, 28 Jun 2017 14:33:00 +0000 (14:33 +0000)]
Auto merge of #42819 - scottmcm:swap-nonoverlapping, r=sfackler

Reuse the mem::swap optimizations to speed up slice::rotate

This is most helpful for compound types where LLVM didn't vectorize the loop.  Highlight: bench slice::rotate_medium_by727_strings gets 38% faster.

Exposes the swapping logic from PR https://github.com/rust-lang/rust/pull/40454 as `pub unsafe fn ptr::swap_nonoverlapping` under library feature `swap_nonoverlapping` https://github.com/rust-lang/rust/issues/42818.

(The new method seemed plausible, and was the simplest way to share the logic.  I'm not attached to it, though, so let me know if a different way would be better.)

7 years agoAuto merge of #42745 - sfackler:1.19-stabilization, r=alexcrichton
bors [Wed, 28 Jun 2017 11:55:37 +0000 (11:55 +0000)]
Auto merge of #42745 - sfackler:1.19-stabilization, r=alexcrichton

1.19 stabilization

r? @alexcrichton

7 years agoAuto merge of #42931 - arielb1:statement-visitor, r=eddyb
bors [Wed, 28 Jun 2017 08:47:29 +0000 (08:47 +0000)]
Auto merge of #42931 - arielb1:statement-visitor, r=eddyb

re-add the call to `super_statement` in EraseRegions

The move gathering code is sensitive to type-equality - that is rather
un-robust and I plan to fix it eventually, but that's a more invasive
change. And we want to fix the visitor anyway.

Fixes #42903.

r? @eddyb

7 years agore-add the call to `super_statement` in EraseRegions
Ariel Ben-Yehuda [Tue, 27 Jun 2017 15:34:07 +0000 (18:34 +0300)]
re-add the call to `super_statement` in EraseRegions

The move gathering code is sensitive to type-equality - that is rather
un-robust and I plan to fix it eventually, but that's a more invasive
change. And we want to fix the visitor anyway.

Fixes #42903.

7 years agoAuto merge of #42709 - stepancheg:discriminant-hash, r=jseyfried
bors [Wed, 28 Jun 2017 06:32:10 +0000 (06:32 +0000)]
Auto merge of #42709 - stepancheg:discriminant-hash, r=jseyfried

deriv(Hash) for single-variant enum should not hash discriminant

Fixes #39137

7 years agoAuto merge of #42431 - nagisa:core-float-2, r=alexcrichton
bors [Wed, 28 Jun 2017 03:41:22 +0000 (03:41 +0000)]
Auto merge of #42431 - nagisa:core-float-2, r=alexcrichton

Fix NaN handling in is_sign_negative/positive

This would be my proposed fix for the #42425 provided we decide it is indeed a problem.

Note this would technically be a breaking change to a stable API. We might want to consider deprecating these methods and adding new ones.

7 years agoAuto merge of #42417 - eddyb:separate-fn-sig, r=nikomatsakis
bors [Wed, 28 Jun 2017 01:12:12 +0000 (01:12 +0000)]
Auto merge of #42417 - eddyb:separate-fn-sig, r=nikomatsakis

Don't drag function signatures along function item types.

This PR separates the signature of a function from the "function item type" (`TyFnDef`), leaving only the `DefId` and parameter `Substs`, making them even more like (captureless) closure types.

The motivation for this change is reducing typesystem complexity, and its consequences:
* operating on the signature instead of just the parameters was less efficient
  * specifically, signatures can easily add several levels of depth on top of the parameter types
  * and the signatured were always substituted and normalized, so typically even more complex
* it was *the only* type that was *both* nominal (identity) and structural (signature)
  * harder to model in Chalk than either a purely nominal or structural type
  * subtyping worked on the signature but parameters were always invariant
  * call type-checking was transforming signatures but keeping the nominal half intact
  * the signature could therefore get out of sync during type inference in several ways

That last point comes with a `[breaking-change]`, because functions with `'static` in their return types will now *not* be as usable as if they were using lifetime parameters instead:
```rust
// Will cause lifetime mismatch in main after this PR.
fn bar() -> &'static str { "bar" }
// Will continue to work fine, as every use can choose its own lifetime.
fn bar<'a>() -> &'a str { "bar" }

fn main() {
    let s = String::from("foo");
    Some(&s[..]).unwrap_or_else(bar);
}
```

r? @nikomatsakis

7 years agoReview comments
Esteban Küber [Tue, 27 Jun 2017 20:34:56 +0000 (13:34 -0700)]
Review comments

- Fix typo
- Add docstring
- Remove spurious test output file

7 years agotests: work around fallout from normalizing signatures separately.
Eduard-Mihai Burtescu [Fri, 2 Jun 2017 19:12:01 +0000 (22:12 +0300)]
tests: work around fallout from normalizing signatures separately.

7 years agorustc_typeck: support functions in variance computation.
Eduard-Mihai Burtescu [Fri, 2 Jun 2017 19:05:41 +0000 (22:05 +0300)]
rustc_typeck: support functions in variance computation.

7 years agorustc: move the PolyFnSig out of TyFnDef.
Eduard-Mihai Burtescu [Sat, 13 May 2017 14:11:52 +0000 (17:11 +0300)]
rustc: move the PolyFnSig out of TyFnDef.

7 years agorustc: rename closure_type to fn_sig.
Eduard-Mihai Burtescu [Sat, 13 May 2017 10:12:29 +0000 (13:12 +0300)]
rustc: rename closure_type to fn_sig.

7 years agoAuto merge of #42922 - frewsxcv:rollup, r=frewsxcv
bors [Tue, 27 Jun 2017 05:12:07 +0000 (05:12 +0000)]
Auto merge of #42922 - frewsxcv:rollup, r=frewsxcv

Rollup of 5 pull requests

- Successful merges: #42519, #42871, #42874, #42905, #42917
- Failed merges:

7 years agoRollup merge of #42917 - kennytm:gdb-fatal-proc-rec, r=Mark-Simulacrum
Corey Farwell [Tue, 27 Jun 2017 03:34:13 +0000 (23:34 -0400)]
Rollup merge of #42917 - kennytm:gdb-fatal-proc-rec, r=Mark-Simulacrum

compiletest: show details why GDB failed to execute.

Help finding reasons of spurious errors due to GDB failing to run (#42693).

7 years agoRollup merge of #42905 - casey:casey-utf8-null-doc, r=steveklabnik
Corey Farwell [Tue, 27 Jun 2017 03:34:12 +0000 (23:34 -0400)]
Rollup merge of #42905 - casey:casey-utf8-null-doc, r=steveklabnik

Reword OsStr docs to clarify that utf8 may contain nulls

The use of the word "but" in the OsStr docs implies (at least to me) that valid UTF-8 does not contain null bytes.

Using "which" instead makes it clear that valid UTF-8 may contain null bytes.

7 years agoRollup merge of #42874 - zackmdavis:overzealous_by_outer_forbid, r=nikomatsakis
Corey Farwell [Tue, 27 Jun 2017 03:34:11 +0000 (23:34 -0400)]
Rollup merge of #42874 - zackmdavis:overzealous_by_outer_forbid, r=nikomatsakis

only set "overruled by outer forbid" once for lint groups, by group name

Previously, conflicting forbid/allow attributes for a lint group would
result in a separate "allow(L) overruled by outer forbid(L)" error for
every lint L in the group. This was needlessly and annoyingly verbose;
we prefer to just have one error pointing out the conflicting
attributes.

(Also, while we're touching context.rs, clean up some unused arguments.)

Resolves #42873.

7 years agoRollup merge of #42871 - llogiq:for_lowering_vs_clippy, r=arielb1
Corey Farwell [Tue, 27 Jun 2017 03:34:10 +0000 (23:34 -0400)]
Rollup merge of #42871 - llogiq:for_lowering_vs_clippy, r=arielb1

change binding name of for loop lowering to appease clippy

With the latest change to for loop lowering (#42634), a `_next` binding was introduced.
Unfortunately, this [disturbs](https://github.com/Manishearth/rust-clippy/issues/1846) clippy's `used_underscore_binding` lint. This commit just renames the binding to `__next` so clippy will be happy. It should have no other effect.

7 years agoRollup merge of #42519 - GuillaumeGomez:create-more-error-codes, r=QuietMisdreavus
Corey Farwell [Tue, 27 Jun 2017 03:34:09 +0000 (23:34 -0400)]
Rollup merge of #42519 - GuillaumeGomez:create-more-error-codes, r=QuietMisdreavus

Create more error codes

Fixes #31174.
Part of #42229.

cc @Susurrus

7 years agoAuto merge of #42916 - Mark-Simulacrum:update-cargo, r=alexcrichton
bors [Mon, 26 Jun 2017 22:42:08 +0000 (22:42 +0000)]
Auto merge of #42916 - Mark-Simulacrum:update-cargo, r=alexcrichton

Update Cargo

Haven't run extensive tests locally (not really sure what to test) but this primarily pulls in minor changes: https://github.com/rust-lang/cargo/pull/4215, https://github.com/rust-lang/cargo/pull/4209, and https://github.com/rust-lang/cargo/pull/4218. The last one fixes the flaky cargo test by ignoring it, which should unblock https://github.com/rust-lang/rust/pull/42745 -- that's beta nominated.

r? @alexcrichton

7 years agocompiletest: show details if GDB failed to execute.
kennytm [Mon, 26 Jun 2017 18:44:42 +0000 (02:44 +0800)]
compiletest: show details if GDB failed to execute.

7 years agoUpdate Cargo
Mark Simulacrum [Mon, 26 Jun 2017 16:26:15 +0000 (10:26 -0600)]
Update Cargo

7 years agoAuto merge of #42885 - ollie27:rustdoc_empty_glob_path, r=GuillaumeGomez
bors [Mon, 26 Jun 2017 11:06:13 +0000 (11:06 +0000)]
Auto merge of #42885 - ollie27:rustdoc_empty_glob_path, r=GuillaumeGomez

rustdoc: Don't ICE on `use *;`

Fixes #42875

7 years agoReword OsStr docs to clarify that utf8 may contain nulls
Casey Rodarmor [Sun, 25 Jun 2017 21:23:43 +0000 (14:23 -0700)]
Reword OsStr docs to clarify that utf8 may contain nulls

7 years agoAuto merge of #42865 - ollie27:rustdoc_assoc_consts, r=GuillaumeGomez
bors [Sun, 25 Jun 2017 17:39:26 +0000 (17:39 +0000)]
Auto merge of #42865 - ollie27:rustdoc_assoc_consts, r=GuillaumeGomez

rustdoc: Fix a few issues with associated consts

* Make sure private consts are stripped.
* Don't show a code block for the value if there is none.
* Make sure default values are shown in impls.
* Make sure docs from the trait are used if the impl has no docs.

7 years agoAdd reference link
Guillaume Gomez [Sun, 25 Jun 2017 07:25:37 +0000 (09:25 +0200)]
Add reference link

7 years agoDon't naively point to return type on type error
Esteban Küber [Sun, 25 Jun 2017 02:28:43 +0000 (19:28 -0700)]
Don't naively point to return type on type error

7 years agoStabilize RangeArgument
Steven Fackler [Mon, 19 Jun 2017 05:01:29 +0000 (22:01 -0700)]
Stabilize RangeArgument

Move it and Bound to core::ops while we're at it.

Closes #30877

7 years agoStabilize ThreadId
Steven Fackler [Thu, 8 Jun 2017 15:41:23 +0000 (11:41 -0400)]
Stabilize ThreadId

Closes #21507

7 years agoStabilize OsString::shrink_to_fit
Steven Fackler [Thu, 8 Jun 2017 15:35:46 +0000 (11:35 -0400)]
Stabilize OsString::shrink_to_fit

Closes #40421

7 years agoStabilize cmp::Reverse
Steven Fackler [Thu, 8 Jun 2017 15:34:22 +0000 (11:34 -0400)]
Stabilize cmp::Reverse

Closes #40893

7 years agoStabilize Command::envs
Steven Fackler [Thu, 8 Jun 2017 15:31:25 +0000 (11:31 -0400)]
Stabilize Command::envs

Closes #38526

7 years agoAuto merge of #42784 - tlively:wasm-bot, r=alexcrichton
bors [Sat, 24 Jun 2017 22:34:08 +0000 (22:34 +0000)]
Auto merge of #42784 - tlively:wasm-bot, r=alexcrichton

Make wasm32 buildbot test LLVM backend

This adds the experimental targets option to configure so it can be used
by the builders and changes the wasm32 Dockerfile accordingly. Instead
of using LLVM from the emsdk, the builder's emscripten tools now uses
the Rust in-tree LLVM, since this is the one built with wasm support.

7 years agoUse new macro instead
Guillaume Gomez [Mon, 12 Jun 2017 16:58:11 +0000 (18:58 +0200)]
Use new macro instead

7 years agowording improvement
Guillaume Gomez [Fri, 9 Jun 2017 20:04:29 +0000 (22:04 +0200)]
wording improvement

7 years agoAdd E0607
Guillaume Gomez [Wed, 7 Jun 2017 22:13:28 +0000 (00:13 +0200)]
Add E0607

7 years agoAdd E0606
Guillaume Gomez [Wed, 7 Jun 2017 21:54:51 +0000 (23:54 +0200)]
Add E0606

7 years agoAdd E0605
Guillaume Gomez [Wed, 7 Jun 2017 20:24:15 +0000 (22:24 +0200)]
Add E0605

7 years agoAdd E0604
Guillaume Gomez [Wed, 7 Jun 2017 18:58:09 +0000 (20:58 +0200)]
Add E0604

7 years agoDo not specify return type in suggestion for some `Ty`s
Esteban Küber [Sat, 24 Jun 2017 19:16:20 +0000 (12:16 -0700)]
Do not specify return type in suggestion for some `Ty`s

Don't specify a suggested return type for `TyAnon`, `TyFnDef`,
`TyFnPtr`, `TyDynamic`, `TyClosure` and `TyProjection`.

7 years agoRestore old emscripten.sh for use by asmjs
Thomas Lively [Sat, 24 Jun 2017 18:35:48 +0000 (11:35 -0700)]
Restore old emscripten.sh for use by asmjs

7 years agorustdoc: Don't ICE on `use *;`
Oliver Middleton [Sat, 24 Jun 2017 17:16:39 +0000 (18:16 +0100)]
rustdoc: Don't ICE on `use *;`

7 years agoSuggest removal of semicolon (instead of being help)
Esteban Küber [Sat, 24 Jun 2017 08:09:57 +0000 (01:09 -0700)]
Suggest removal of semicolon (instead of being help)

7 years agoAuto merge of #42864 - slo1:attempt, r=Mark-Simulacrum
bors [Sat, 24 Jun 2017 14:43:01 +0000 (14:43 +0000)]
Auto merge of #42864 - slo1:attempt, r=Mark-Simulacrum

Saves created temp directory if save-temps option is used.

Should fix #38068.

7 years agoAuto merge of #42541 - gilescope:patch-1, r=alexcrichton
bors [Sat, 24 Jun 2017 12:18:40 +0000 (12:18 +0000)]
Auto merge of #42541 - gilescope:patch-1, r=alexcrichton

assert_eq failure message easier to read

By having the left and right strings aligned with one another it helps spot the difference between the two far quicker than if they are on the same line.

E.g.
Before:

```
thread 'tests::test_safe_filename' panicked at 'assertion failed: `(left == right)` left:  `"-aandb--S123.html"` right: `"-aandb-S123.html"`',
```

After:

```
thread 'tests::test_safe_filename' panicked at 'assertion failed: `(left == right)`
left:  `"-aandb--S123.html"`
right: `"-aandb-S123.html"`',
```

When the strings are both on the same line it take a lot longer to spot the difference. It is a small change but the small time savings add up with repetition. This would help Rust be an excellent language to write tests in out of the box.

Closes https://github.com/rust-lang/rust/issues/41615

7 years agoAuto merge of #42854 - razielgn:relaxed-debug-constraints-on-maps-iterators, r=sfackler
bors [Sat, 24 Jun 2017 09:32:20 +0000 (09:32 +0000)]
Auto merge of #42854 - razielgn:relaxed-debug-constraints-on-maps-iterators, r=sfackler

Relaxed Debug constraints on {HashMap,BTreeMap}::{Keys,Values}.

I has hit by this yesterday too. 😄
And I've realised that Debug for BTreeMap::{Keys,Values} wasn't formatting just keys and values respectively, but the whole map. 🤔

Fixed #41924

r? @jonhoo

7 years agoDetect missing `;` on methods with return type `()`
Esteban Küber [Sat, 24 Jun 2017 07:57:39 +0000 (00:57 -0700)]
Detect missing `;` on methods with return type `()`

- Point out the origin of a type requirement when it is the return type
  of a method
- Point out possibly missing semicolon when the return type is () and
  the implicit return makes sense as a statement
- Suggest changing the return type of methods with default return type
- Don't suggest changing the return type on fn main()
- Don't suggest changing the return type on impl fn

7 years agoAuto merge of #42724 - Mark-Simulacrum:tests, r=alexcrichton
bors [Sat, 24 Jun 2017 07:10:10 +0000 (07:10 +0000)]
Auto merge of #42724 - Mark-Simulacrum:tests, r=alexcrichton

Add tests for a few issues.

Fixes #41998
Fixes #38381
Fixes #37515
Fixes #37510
Fixes #37366
Fixes #37323
Fixes #37051
Fixes #36839
Fixes #35570
Fixes #34373
Fixes #34222

Certainly not all of the E-needstest issues right now, but I started to get bored.

7 years agoonly set "overruled by outer forbid" once for lint groups, by group name
Zack M. Davis [Sat, 24 Jun 2017 02:22:06 +0000 (19:22 -0700)]
only set "overruled by outer forbid" once for lint groups, by group name

Previously, conflicting forbid/allow attributes for a lint group would
result in a separate "allow(L) overruled by outer forbid(L)" error for
every lint L in the group. This was needlessly and annoyingly verbose;
we prefer to just have one error pointing out the conflicting
attributes.

Resolves #42873.

7 years agoAuto merge of #42687 - alexcrichton:windows-tls, r=sfackler
bors [Sat, 24 Jun 2017 04:42:18 +0000 (04:42 +0000)]
Auto merge of #42687 - alexcrichton:windows-tls, r=sfackler

rustc: Enable #[thread_local] for Windows

I think LLVM has had support for quite some time now for this, we just never got
around to testing it out and binding it. We've had some trouble landing this in
the past I believe, but it's time to try again!

This commit flags the `#[thread_local]` attribute as being available for Windows
targets and adds an implementation of `register_dtor` in the `thread::local`
module to ensure we can destroy these keys. The same functionality is
implemented in clang via a function called `__tlregdtor` (presumably provided in
some Windows runtime somewhere), but this function unfortunately does not take a
data pointer (just a thunk) which means we can't easily call it. For now
destructors are just run in the same way the Linux fallback is implemented,
which is just keeping track via a single OS-based TLS key.

7 years agoremove unused parameters from LintStore.find_lint
Zack M. Davis [Sat, 24 Jun 2017 01:29:30 +0000 (18:29 -0700)]
remove unused parameters from LintStore.find_lint

Long ago, in the before-time, the find_lint method was created with the
unused_variables ("unused_variable" in the singular, as it was called at
the time) attribute in anticipation of using the session and span in the
handling of renamed lints (31b7d64fd), and indeed, the session and span
came to be used in this method, while the unused_variables attribute
remained (1ad1e2e29). In modern times, the session and span are again no
longer used (ca81d3dd); it seems we can safely prune them from the
method signature, for justice, and mercy.

7 years agoMove tests to `ui`
Esteban Küber [Sat, 24 Jun 2017 00:43:35 +0000 (17:43 -0700)]
Move tests to `ui`

7 years agoAdd Target (de)serialization for environment vars
Thomas Lively [Sat, 24 Jun 2017 00:26:39 +0000 (17:26 -0700)]
Add Target (de)serialization for environment vars

Also turn WebAssembly backend back on in its builder.

7 years agorustc: Enable #[thread_local] for Windows
Alex Crichton [Wed, 17 Feb 2016 07:07:09 +0000 (23:07 -0800)]
rustc: Enable #[thread_local] for Windows

I think LLVM has had support for quite some time now for this, we just never got
around to testing it out and binding it. We've had some trouble landing this in
the past I believe, but it's time to try again!

This commit flags the `#[thread_local]` attribute as being available for Windows
targets and adds an implementation of `register_dtor` in the `thread::local`
module to ensure we can destroy these keys. The same functionality is
implemented in clang via a function called `__tlregdtor` (presumably provided in
some Windows runtime somewhere), but this function unfortunately does not take a
data pointer (just a thunk) which means we can't easily call it. For now
destructors are just run in the same way the Linux fallback is implemented,
which is just keeping track via a single OS-based TLS key.

7 years agorustdoc: Fix a few issues with associated consts
Oliver Middleton [Fri, 23 Jun 2017 17:39:27 +0000 (18:39 +0100)]
rustdoc: Fix a few issues with associated consts

* Make sure private consts are stripped.
* Don't show a code block for the value if there is none.
* Make sure default values are shown in impls.
* Make sure docs from the trait are used if the impl has no docs.

7 years agoSaves created temp directory if save-temps option is used.
slo [Fri, 23 Jun 2017 17:20:23 +0000 (13:20 -0400)]
Saves created temp directory if save-temps option is used.

7 years agochange binding name of for loop lowering to appease clippy
Andre Bogus [Fri, 23 Jun 2017 16:23:23 +0000 (18:23 +0200)]
change binding name of for loop lowering to appease clippy

With the latest change to for loop lowering, a `_next` binding was introduced.
Unfortunately, this disturbs clippy's `used_underscore_binding` lint. This
commit just renames the binding to `__next` so clippy will be happy. It should
have no other effect.

7 years agoAdd tests for a few issues.
Mark Simulacrum [Sat, 17 Jun 2017 20:43:10 +0000 (14:43 -0600)]
Add tests for a few issues.

7 years agoAuto merge of #42856 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Fri, 23 Jun 2017 13:46:43 +0000 (13:46 +0000)]
Auto merge of #42856 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 8 pull requests

- Successful merges: #42777, #42783, #42787, #42821, #42822, #42825, #42829, #42833
- Failed merges:

7 years agoRollup merge of #42833 - durka:non-constant-used-with-constant, r=Mark-Simulacrum
Mark Simulacrum [Fri, 23 Jun 2017 12:02:15 +0000 (06:02 -0600)]
Rollup merge of #42833 - durka:non-constant-used-with-constant, r=Mark-Simulacrum

change span label for E0435

r? @Mark-Simulacrum

7 years agoRollup merge of #42829 - ids1024:cxx, r=alexcrichton
Mark Simulacrum [Fri, 23 Jun 2017 12:02:14 +0000 (06:02 -0600)]
Rollup merge of #42829 - ids1024:cxx, r=alexcrichton

Set CXX_<target> in bootstrap

I came across this trying to cross-compile rustc for Redox. It was also mentioned in a comment on https://github.com/rust-lang/rust/pull/42206, but doesn't seem to have been corrected.

7 years agoRollup merge of #42825 - letheed:patch-1, r=alexcrichton
Mark Simulacrum [Fri, 23 Jun 2017 12:02:12 +0000 (06:02 -0600)]
Rollup merge of #42825 - letheed:patch-1, r=alexcrichton

Fix ref as mutable ref in std::rc::Rc doc

7 years agoRollup merge of #42822 - ChrisMacNaughton:guard-traits, r=alexcrichton
Mark Simulacrum [Fri, 23 Jun 2017 12:02:11 +0000 (06:02 -0600)]
Rollup merge of #42822 - ChrisMacNaughton:guard-traits, r=alexcrichton

Ensure Guard types impl Display & Debug

Fixes #24372

7 years agoRollup merge of #42821 - michaelwoerister:incr-debug-output-on-stderr, r=alexcrichton
Mark Simulacrum [Fri, 23 Jun 2017 12:02:10 +0000 (06:02 -0600)]
Rollup merge of #42821 - michaelwoerister:incr-debug-output-on-stderr, r=alexcrichton

Print -Zincremental-info to stderr instead of stdout.

Fixes #42583.

The [cargo-incremental](https://github.com/nikomatsakis/cargo-incremental) tool probably does not need to be updated. It already merges stdout and stderr before parsing the compiler's output.

r? @alexcrichton

7 years agoRollup merge of #42787 - zackmdavis:explain_E0562, r=GuillaumeGomez
Mark Simulacrum [Fri, 23 Jun 2017 12:02:09 +0000 (06:02 -0600)]
Rollup merge of #42787 - zackmdavis:explain_E0562, r=GuillaumeGomez

add extended information for E0562; impl Trait can only be a return type

r? @GuillaumeGomez

7 years agoRollup merge of #42783 - ids1024:redox-env, r=sfackler
Mark Simulacrum [Fri, 23 Jun 2017 12:02:08 +0000 (06:02 -0600)]
Rollup merge of #42783 - ids1024:redox-env, r=sfackler

Redox: Use create() instead of open() when setting env variable

See https://github.com/redox-os/kernel/pull/25.

7 years agoRollup merge of #42777 - kennytm:kill-ignore-doctest, r=estebank
Mark Simulacrum [Fri, 23 Jun 2017 12:02:08 +0000 (06:02 -0600)]
Rollup merge of #42777 - kennytm:kill-ignore-doctest, r=estebank

Remove most "```ignore" doc tests.

Unconditional ` ```ignore ` doc tests lead to outdated examples (e.g. https://github.com/rust-lang/rust/issues/42729#issuecomment-309346572). This PR tries to change all existing ` ```ignore ` tests into one of the following:

* Add import and declarations to ensure the code is run-pass
* If the code is not Rust, change to ` ```text `/` ```sh `/` ```json `/` ```dot `
* If the code is expected compile-fail, change to ` ```compile_fail `
* If the code is expected run-fail, change to ` ```should_panic `
* If the code can type-check but cannot link/run, change to ` ```no_run `
* Otherwise, add an explanation after the ` ```ignore `

The `--explain` handling is changed to cope with hidden lines from the error index.

Tidy is changed to reject any unexplained ` ```ignore ` and ` ```rust,ignore `.

7 years agoRelax Debug constraints when debugging {HashMap,BTreeMap}::{Keys,Values}.
Federico Ravasio [Fri, 23 Jun 2017 10:48:19 +0000 (12:48 +0200)]
Relax Debug constraints when debugging {HashMap,BTreeMap}::{Keys,Values}.

Fixed #41924.

7 years agoCorrectly iterate on keys/values when debugging BTreeMap::{Keys,Values}.
Federico Ravasio [Fri, 23 Jun 2017 10:47:43 +0000 (12:47 +0200)]
Correctly iterate on keys/values when debugging BTreeMap::{Keys,Values}.

7 years agoAdded a tidy check to disallow "```ignore" and "```rust,ignore".
kennytm [Tue, 20 Jun 2017 17:00:02 +0000 (01:00 +0800)]
Added a tidy check to disallow "```ignore" and "```rust,ignore".

7 years agoModify --explain to handle hidden code (`# ...`) and indented code blocks.
kennytm [Tue, 20 Jun 2017 07:53:03 +0000 (15:53 +0800)]
Modify --explain to handle hidden code (`# ...`) and indented code blocks.

7 years agoRemoved as many "```ignore" as possible.
kennytm [Tue, 20 Jun 2017 07:15:16 +0000 (15:15 +0800)]
Removed as many "```ignore" as possible.

Replaced by adding extra imports, adding hidden code (`# ...`), modifying
examples to be runnable (sorry Homura), specifying non-Rust code, and
converting to should_panic, no_run, or compile_fail.

Remaining "```ignore"s received an explanation why they are being ignored.

7 years agoAuto merge of #42828 - parched:umulo, r=alexcrichton
bors [Fri, 23 Jun 2017 05:25:22 +0000 (05:25 +0000)]
Auto merge of #42828 - parched:umulo, r=alexcrichton

Update LLVM to fix unsigned multiplication overflow

check for some targets, notably ARMv6-M.

Fixes https://github.com/rust-lang-nursery/compiler-builtins/issues/150

7 years agoAdd wasm32-experimental-emscripten to wasm builder
Thomas Lively [Fri, 23 Jun 2017 01:04:20 +0000 (18:04 -0700)]
Add wasm32-experimental-emscripten to wasm builder

This modifies the builder to download and use the LLVM tools from the
last known good build on the WebAssembly buildbot waterfall, since these
tools are built with the WebAssembly LLVM backend enabled.

7 years agoAdd target option for linker environment variables
Thomas Lively [Thu, 22 Jun 2017 22:16:54 +0000 (15:16 -0700)]
Add target option for linker environment variables

This is used in wasm32-experimental-emscripten to ensure that emscripten
links against the libc bitcode files produced by the wasm LLVM backend,
instead of using fastcomp.

7 years agoMake wasm32 buildbot test LLVM backend
Thomas Lively [Tue, 20 Jun 2017 20:37:58 +0000 (13:37 -0700)]
Make wasm32 buildbot test LLVM backend

This adds the experimental targets option to configure so it can be used
by the builders and changes the wasm32 Dockerfile accordingly. Instead
of using LLVM from the emsdk, the builder's emscripten tools now uses
the Rust in-tree LLVM, since this is the one built with wasm support.

7 years agoAuto merge of #42304 - Mark-Simulacrum:issue-37157, r=nikomatsakis
bors [Fri, 23 Jun 2017 00:32:40 +0000 (00:32 +0000)]
Auto merge of #42304 - Mark-Simulacrum:issue-37157, r=nikomatsakis

Print the two types in the span label for transmute errors.

Fixes #37157. I'm not entirely happy with the changes here but overall it's better in my opinion; we certainly avoid the odd language in that issue, which changes to:

```
error[E0512]: transmute called with differently sized types: <C as TypeConstructor<'a>>::T (size can vary because of <C as TypeConstructor>::T) to <C as TypeConstructor<'b>>::T (size can vary because of <C as TypeConstructor>::T)
 --> test.rs:8:5
  |
8 |     ::std::mem::transmute(x)
  |     ^^^^^^^^^^^^^^^^^^^^^ transmuting between <C as TypeConstructor<'a>>::T and <C as TypeConstructor<'b>>::T

error: aborting due to previous error(s)
```

7 years agoAuto merge of #42614 - GuillaumeGomez:new-error-codes, r=pnkfelix
bors [Thu, 22 Jun 2017 21:46:08 +0000 (21:46 +0000)]
Auto merge of #42614 - GuillaumeGomez:new-error-codes, r=pnkfelix

New error codes

Part of #42229.

cc @Susurrus @frewsxcv @QuietMisdreavus

7 years agoAdding training commer to be more consistent with prior format.
Giles Cope [Thu, 22 Jun 2017 21:18:57 +0000 (22:18 +0100)]
Adding training commer to be more consistent with prior format.

7 years agoFix NaN handling in is_sign_negative/positive
Simonas Kazlauskas [Sun, 4 Jun 2017 18:44:57 +0000 (21:44 +0300)]
Fix NaN handling in is_sign_negative/positive

See #42425

7 years agoremove duplicate E0435 test
Alex Burka [Thu, 22 Jun 2017 19:13:09 +0000 (19:13 +0000)]
remove duplicate E0435 test

7 years agochange span label for E0435 (fix #41871)
Alex Burka [Thu, 22 Jun 2017 19:10:56 +0000 (19:10 +0000)]
change span label for E0435 (fix #41871)

7 years agoMake Build.cxx() return a Result instead of panicking
Ian Douglas Scott [Thu, 22 Jun 2017 18:51:32 +0000 (11:51 -0700)]
Make Build.cxx() return a Result instead of panicking

7 years agoSet CXX_<target> in bootstrap
Ian Douglas Scott [Thu, 22 Jun 2017 17:42:10 +0000 (10:42 -0700)]
Set CXX_<target> in bootstrap

7 years agoAuto merge of #42634 - Zoxc:for-desugar2, r=nikomatsakis
bors [Thu, 22 Jun 2017 15:24:58 +0000 (15:24 +0000)]
Auto merge of #42634 - Zoxc:for-desugar2, r=nikomatsakis

Change the for-loop desugar so the `break` does not affect type inference. Fixes #42618

Rewrite the `for` loop desugaring to avoid contaminating the inference results. Under the older desugaring, `for x in vec![] { .. }` would erroneously type-check, even though the type of `vec![]` is unconstrained. (written by @nikomatsakis)

7 years agoEnsure Guard types impl Display & Debug
Chris MacNaughton [Thu, 22 Jun 2017 10:01:22 +0000 (12:01 +0200)]
Ensure Guard types impl Display & Debug

Fixes #24372

7 years agoFix ref as mutable ref in std::rc::Rc doc
Letheed [Thu, 22 Jun 2017 13:48:20 +0000 (15:48 +0200)]
Fix ref as mutable ref in std::rc::Rc doc

7 years agoAuto merge of #42824 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Thu, 22 Jun 2017 12:48:54 +0000 (12:48 +0000)]
Auto merge of #42824 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 4 pull requests

- Successful merges: #42799, #42804, #42805, #42806
- Failed merges:

7 years agoRollup merge of #42806 - ollie27:rustbuild_compiler_docs, r=alexcrichton
Mark Simulacrum [Thu, 22 Jun 2017 12:30:12 +0000 (06:30 -0600)]
Rollup merge of #42806 - ollie27:rustbuild_compiler_docs, r=alexcrichton

rustbuild: Fix compiler docs yet again

Add support for `-Z force-unstable-if-unmarked` to rustdoc.

r? @alexcrichton

7 years agoRollup merge of #42805 - stepancheg:forward-python, r=alexcrichton
Mark Simulacrum [Thu, 22 Jun 2017 12:30:11 +0000 (06:30 -0600)]
Rollup merge of #42805 - stepancheg:forward-python, r=alexcrichton

Pass path to python from bootstrap.py to bootstrap.rs

When bootstrap is executed with python not in `$PATH`, (e. g.
`c:\Python27\python.exe x.py test`) bootstrap cannot find python
and crashes.

This commit passes path to python in `BOOTSTRAP_PYTHON` env var.

7 years agoRollup merge of #42804 - Mark-Simulacrum:rustbuild-colors, r=alexcrichton
Mark Simulacrum [Thu, 22 Jun 2017 12:30:10 +0000 (06:30 -0600)]
Rollup merge of #42804 - Mark-Simulacrum:rustbuild-colors, r=alexcrichton

Make rustc errors colorful.

Rustbuild passes --message-format=json to Cargo to learn about the
dependencies for a given build, which then makes Cargo steal the
stderr/stdout for the compiler process, leading to non colorful output.
To avoid this, detection of stderr being a tty is added to rustbuild,
and an environment variable is used to communicate with the rustc shim.

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

r? @alexcrichton

7 years agoRollup merge of #42799 - leodasvacas:impl-clone-for-default-hasher, r=sfackler
Mark Simulacrum [Thu, 22 Jun 2017 12:30:09 +0000 (06:30 -0600)]
Rollup merge of #42799 - leodasvacas:impl-clone-for-default-hasher, r=sfackler

Impl Clone for DefaultHasher

It's useful for a hasher to be `Clone`. It's also strange for any type to not be `Clone`. `DefaultHasher` is not meant to be used directly, but being in std it can be useful as a placeholder. I don't see any forward compatibility hazard if the hasher is changed since it's very rare for something to not be `Clone`.

7 years agoAuto merge of #42798 - stepancheg:args-debug, r=sfackler
bors [Thu, 22 Jun 2017 10:34:21 +0000 (10:34 +0000)]
Auto merge of #42798 - stepancheg:args-debug, r=sfackler

Better Debug for Args and ArgsOs

Display actual args instead of two dots.

7 years agoPrint -Zincremental-info to stderr instead of stdout.
Michael Woerister [Thu, 22 Jun 2017 08:27:45 +0000 (10:27 +0200)]
Print -Zincremental-info to stderr instead of stdout.

7 years agoAuto merge of #42803 - michaelwoerister:msdia-workaround, r=vadimcn
bors [Thu, 22 Jun 2017 08:10:27 +0000 (08:10 +0000)]
Auto merge of #42803 - michaelwoerister:msdia-workaround, r=vadimcn

debuginfo: Work around crash-bug in MSDIA library

Fixes https://github.com/rust-lang/rust/issues/40477 (which also contains a description of the issue being fixed).

r? @vadimcn

7 years agodebuginfo: Work around crash-bug in MSDIA library
Michael Woerister [Wed, 21 Jun 2017 14:38:22 +0000 (17:38 +0300)]
debuginfo: Work around crash-bug in MSDIA library

7 years agoReuse the mem::swap optimizations to speed up slice::rotate
Scott McMurray [Wed, 21 Jun 2017 06:48:15 +0000 (23:48 -0700)]
Reuse the mem::swap optimizations to speed up slice::rotate

Exposes the swapping logic from PR 40454 as `pub unsafe fn ptr::swap_nonoverlapping` under feature swap_nonoverlapping

This is most helpful for compound types where LLVM didn't vectorize the loop.  Highlight: bench slice::rotate_medium_by727_strings gets 38% faster.

7 years agoAuto merge of #42785 - Mark-Simulacrum:fix-verbose-bootstrap, r=alexcrichton
bors [Thu, 22 Jun 2017 05:50:58 +0000 (05:50 +0000)]
Auto merge of #42785 - Mark-Simulacrum:fix-verbose-bootstrap, r=alexcrichton

Fixes bootstrapping with custom cargo/rustc.

config.mk is now always read when parsing the configuration to prevent
this from reoccurring in the future, hopefully.

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

r? @alexcrichton

cc @infinity0 @kyrias

7 years agoAuto merge of #42682 - alexcrichton:jobserver, r=michaelwoerister
bors [Thu, 22 Jun 2017 00:32:42 +0000 (00:32 +0000)]
Auto merge of #42682 - alexcrichton:jobserver, r=michaelwoerister

Integrate jobserver support to parallel codegen

This commit integrates the `jobserver` crate into the compiler. The crate was
previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose
here is to two-fold:

* Primarily the compiler can cooperate with Cargo on parallelism. When you run
  `cargo build -j4` then this'll make sure that the entire build process between
  Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc
  instances which may all try to spawn lots of threads.

* Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver.
  This means that if you call cargo/rustc from `make` or another
  jobserver-compatible implementation it'll use foreign parallelism settings
  instead of creating new ones locally.

As the number of parallel codegen instances in the compiler continues to grow
over time with the advent of incremental compilation it's expected that this'll
become more of a problem, so this is intended to nip concurrent concerns in the
bud by having all the tools to cooperate!

Note that while rustc has support for itself creating a jobserver it's far more
likely that rustc will always use the jobserver configured by Cargo. Cargo today
will now set a jobserver unconditionally for rustc to use.

7 years agoUpdating cargo to latest
Giles Cope [Wed, 21 Jun 2017 23:50:06 +0000 (00:50 +0100)]
Updating cargo to latest