]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #42919 - zackmdavis:once_again_we_heard_you_the_first_time, r=eddyb
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:07 +0000 (08:40 +0000)]
Rollup merge of #42919 - zackmdavis:once_again_we_heard_you_the_first_time, r=eddyb

make lint on-by-default/implied-by messages appear only once

From review discussion on #38103 (https://github.com/rust-lang/rust/pull/38103#discussion_r94845060).

![we_heard](https://user-images.githubusercontent.com/1076988/27564103-6284b78e-5a8a-11e7-9d35-f7f297ca9573.png)

r? @nikomatsakis

7 years agoRollup merge of #42901 - alexcrichton:alloc-one, r=sfackler
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:06 +0000 (08:40 +0000)]
Rollup merge of #42901 - alexcrichton:alloc-one, r=sfackler

std: Fix implementation of `Alloc::alloc_one`

This had an accidental `u8 as *mut T` where it was intended to have just a
normal pointer-to-pointer cast.

Closes #42827

7 years agoRollup merge of #42886 - durka:pplmm-mwe, r=petrochenkov
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:05 +0000 (08:40 +0000)]
Rollup merge of #42886 - durka:pplmm-mwe, r=petrochenkov

syntax: allow negative integer literal expression to be interpolated as pattern

Fixes #42820.

r? @jseyfried

7 years agoRollup merge of #42884 - stepancheg:set-env-run-pass, r=alexcrichton
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:04 +0000 (08:40 +0000)]
Rollup merge of #42884 - stepancheg:set-env-run-pass, r=alexcrichton

Move global vars changing tests into run-pass

Should fix race #42795

7 years agoRollup merge of #42832 - rthomas:doc-fmt, r=steveklabnik
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:03 +0000 (08:40 +0000)]
Rollup merge of #42832 - rthomas:doc-fmt, r=steveklabnik

Update docs for std::fmt::format #29355.

This rewords and removes the `Arguments` section from the docs for
fmt::format.

r? @steveklabnik

7 years agoRollup merge of #42831 - rthomas:master, r=QuietMisdreavus
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:02 +0000 (08:40 +0000)]
Rollup merge of #42831 - rthomas:master, r=QuietMisdreavus

Update docs for fmt::write.

#29355

I reworded it slightly to make it more clear that the function only take
two arguments - the output and the Arguments struct that can be
generated from the format_args! macro.

r? @steveklabnik

7 years agoRollup merge of #42219 - pwoolcoc:add-allow-fail-to-libtest, r=GuillaumeGomez
Ariel Ben-Yehuda [Thu, 29 Jun 2017 08:40:01 +0000 (08:40 +0000)]
Rollup merge of #42219 - pwoolcoc:add-allow-fail-to-libtest, r=GuillaumeGomez

add `allow_fail` test attribute

This change allows the user to add an `#[allow_fail]` attribute to
tests that will cause the test to compile & run, but if the test fails
it will not cause the entire test run to fail. The test output will
show the failure, but in yellow instead of red, and also indicate that
it was an allowed failure.

Here is an example of the output: http://imgur.com/a/wt7ga

7 years agoAuto merge of #42848 - ids1024:redox-fix, r=sfackler
bors [Thu, 29 Jun 2017 06:20:17 +0000 (06:20 +0000)]
Auto merge of #42848 - ids1024:redox-fix, r=sfackler

Fix Redox build, broken in ecbb896b9eb2acadefde57be493e4298c1aa04a3

7 years agoAuto merge of #42642 - venkatagiri:issue_42312, r=nikomatsakis
bors [Thu, 29 Jun 2017 02:30:53 +0000 (02:30 +0000)]
Auto merge of #42642 - venkatagiri:issue_42312, r=nikomatsakis

rustc_typeck: enforce argument type is sized

closes #42312

r? @nikomatsakis

7 years agoAuto merge of #42797 - arielb1:ex-falso-ice, r=nikomatsakis
bors [Wed, 28 Jun 2017 23:58:11 +0000 (23:58 +0000)]
Auto merge of #42797 - arielb1:ex-falso-ice, r=nikomatsakis

avoid translating roots with predicates that do not hold

Finally I got around to doing this.

Fixes #37725.

r? @nikomatsakis

7 years agoadd comments
Ariel Ben-Yehuda [Wed, 28 Jun 2017 20:50:24 +0000 (23:50 +0300)]
add comments

7 years agorustc_typeck: use body-id of type-checking item in need_type_info
Venkata Giri Reddy [Wed, 28 Jun 2017 16:26:36 +0000 (16:26 +0000)]
rustc_typeck: use body-id of type-checking item in need_type_info

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 agorustc_typeck: enforce argument type is sized
Venkata Giri Reddy [Tue, 13 Jun 2017 20:22:28 +0000 (20:22 +0000)]
rustc_typeck: enforce argument type is sized

7 years agorustc_typeck: remove old-style WF obligation
Venkata Giri Reddy [Tue, 13 Jun 2017 20:14:23 +0000 (20:14 +0000)]
rustc_typeck: remove old-style WF obligation

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 agosyntax: allow negative integer literal expression to be interpolated as pattern
Alex Burka [Sat, 24 Jun 2017 18:26:04 +0000 (18:26 +0000)]
syntax: allow negative integer literal expression to be interpolated as pattern

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 agomake lint on-by-default/implied-by messages appear only once
Zack M. Davis [Mon, 26 Jun 2017 20:30:21 +0000 (13:30 -0700)]
make lint on-by-default/implied-by messages appear only once

From review discussion on #38103
(https://github.com/rust-lang/rust/pull/38103#discussion_r94845060).

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 agostd: Fix implementation of `Alloc::alloc_one`
Alex Crichton [Sun, 25 Jun 2017 18:33:47 +0000 (11:33 -0700)]
std: Fix implementation of `Alloc::alloc_one`

This had an accidental `u8 as *mut T` where it was intended to have just a
normal pointer-to-pointer cast.

Closes #42827

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 agoonly show allowed failure count if there are allowed failures
Paul Woolcock [Sun, 25 Jun 2017 00:37:15 +0000 (20:37 -0400)]
only show allowed failure count if there are allowed failures

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 agoAdd compile-fail test for the new feature gate
Paul Woolcock [Fri, 23 Jun 2017 15:01:41 +0000 (11:01 -0400)]
Add compile-fail test for the new feature gate

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 agoAdd a feature gate for the `#[allow_fail]` attribute
Paul Woolcock [Fri, 23 Jun 2017 13:43:28 +0000 (09:43 -0400)]
Add a feature gate for the `#[allow_fail]` attribute

7 years agoMove global vars changing tests into run-pass
Stepan Koltsov [Sat, 24 Jun 2017 15:23:39 +0000 (18:23 +0300)]
Move global vars changing tests into run-pass

Should fix race #42795

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 agofix some tests i missed
Paul Woolcock [Thu, 25 May 2017 20:17:29 +0000 (16:17 -0400)]
fix some tests i missed

7 years agoShorten some lines so this can pass the tidy checks
Paul Woolcock [Thu, 25 May 2017 15:36:18 +0000 (11:36 -0400)]
Shorten some lines so this can pass the tidy checks

7 years agoadd `allow_fail` test attribute
Paul Woolcock [Wed, 24 May 2017 17:58:37 +0000 (13:58 -0400)]
add `allow_fail` test attribute

This change allows the user to add an `#[allow_fail]` attribute to
tests that will cause the test to compile & run, but if the test fails
it will not cause the entire test run to fail. The test output will
show the failure, but in yellow instead of red, and also indicate that
it was an allowed failure.

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 agoFix Redox build, broken in ecbb896b9eb2acadefde57be493e4298c1aa04a3
Ian Douglas Scott [Fri, 23 Jun 2017 02:14:26 +0000 (19:14 -0700)]
Fix Redox build, broken in ecbb896b9eb2acadefde57be493e4298c1aa04a3

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.