Commit graph

65280 commits

Author SHA1 Message Date
Ariel Ben-Yehuda 4bae0d8b7f Rollup merge of #42884 - stepancheg:set-env-run-pass, r=alexcrichton
Move global vars changing tests into run-pass

Should fix race #42795
2017-06-29 08:40:04 +00:00
Ariel Ben-Yehuda 5682494cf8 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
2017-06-29 08:40:03 +00:00
Ariel Ben-Yehuda 8b32c511e7 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
2017-06-29 08:40:02 +00:00
Ariel Ben-Yehuda bea4e60327 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
2017-06-29 08:40:01 +00:00
bors dc2003b7cc Auto merge of #42848 - ids1024:redox-fix, r=sfackler
Fix Redox build, broken in ecbb896b9e
2017-06-29 06:20:17 +00:00
bors 0816b94f02 Auto merge of #42642 - venkatagiri:issue_42312, r=nikomatsakis
rustc_typeck: enforce argument type is sized

closes #42312

r? @nikomatsakis
2017-06-29 02:30:53 +00:00
bors c28cbfb127 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
2017-06-28 23:58:11 +00:00
Ariel Ben-Yehuda a6ca302097 add comments 2017-06-28 23:50:24 +03:00
Venkata Giri Reddy 5ed21f5d47 rustc_typeck: use body-id of type-checking item in need_type_info 2017-06-28 20:19:52 +00:00
bors 69c65d2961 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)
2017-06-28 20:16:13 +00:00
Venkata Giri Reddy 74cb315a10 rustc_typeck: enforce argument type is sized 2017-06-28 17:54:18 +00:00
Venkata Giri Reddy 6db48380ce rustc_typeck: remove old-style WF obligation 2017-06-28 17:54:17 +00:00
bors 47faf1d519 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.)
2017-06-28 14:33:00 +00:00
bors c16930762a Auto merge of #42745 - sfackler:1.19-stabilization, r=alexcrichton
1.19 stabilization

r? @alexcrichton
2017-06-28 11:55:37 +00:00
bors 6b52a1162e 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
2017-06-28 08:47:29 +00:00
Ariel Ben-Yehuda 71abfa7b91 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.
2017-06-28 11:01:42 +03:00
bors 5bc8941638 Auto merge of #42709 - stepancheg:discriminant-hash, r=jseyfried
deriv(Hash) for single-variant enum should not hash discriminant

Fixes #39137
2017-06-28 06:32:10 +00:00
bors 88c3242ef2 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.
2017-06-28 03:41:22 +00:00
bors 4079e6128f 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
2017-06-28 01:12:12 +00:00
Esteban Küber 7dad2958be Review comments
- Fix typo
- Add docstring
- Remove spurious test output file
2017-06-27 13:34:56 -07:00
Eduard-Mihai Burtescu 69076f3a78 tests: work around fallout from normalizing signatures separately. 2017-06-27 16:39:58 +03:00
Eduard-Mihai Burtescu a9d4069975 rustc_typeck: support functions in variance computation. 2017-06-27 16:39:58 +03:00
Eduard-Mihai Burtescu 33ecf72e8e rustc: move the PolyFnSig out of TyFnDef. 2017-06-27 16:39:52 +03:00
Eduard-Mihai Burtescu 8e53a03d15 rustc: rename closure_type to fn_sig. 2017-06-27 16:32:48 +03:00
bors f590a44ce6 Auto merge of #42922 - frewsxcv:rollup, r=frewsxcv
Rollup of 5 pull requests

- Successful merges: #42519, #42871, #42874, #42905, #42917
- Failed merges:
2017-06-27 05:12:07 +00:00
Corey Farwell d7a5508069 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).
2017-06-26 23:34:13 -04:00
Corey Farwell 83d4b43422 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.
2017-06-26 23:34:12 -04:00
Corey Farwell 7808fddede 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.
2017-06-26 23:34:11 -04:00
Corey Farwell b1afcb6ae9 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.
2017-06-26 23:34:10 -04:00
Corey Farwell b2c313007d Rollup merge of #42519 - GuillaumeGomez:create-more-error-codes, r=QuietMisdreavus
Create more error codes

Fixes #31174.
Part of #42229.

cc @Susurrus
2017-06-26 23:34:09 -04:00
bors 77931c2a04 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
2017-06-26 22:42:08 +00:00
kennytm 3f1cb30b14
compiletest: show details if GDB failed to execute. 2017-06-27 02:44:42 +08:00
Mark Simulacrum 38b468832f Update Cargo 2017-06-26 10:30:36 -06:00
bors 859c3236e5 Auto merge of #42885 - ollie27:rustdoc_empty_glob_path, r=GuillaumeGomez
rustdoc: Don't ICE on `use *;`

Fixes #42875
2017-06-26 11:06:13 +00:00
Casey Rodarmor 0d985c9e87 Reword OsStr docs to clarify that utf8 may contain nulls 2017-06-25 14:23:43 -07:00
bors fc9ccfdbe0 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.
2017-06-25 17:39:26 +00:00
Paul Woolcock 4154f895d3 only show allowed failure count if there are allowed failures 2017-06-25 12:23:20 -04:00
Guillaume Gomez bcf0d600f3 Add reference link 2017-06-25 09:25:37 +02:00
Esteban Küber c13a913e5b Don't naively point to return type on type error 2017-06-24 19:28:43 -07:00
Steven Fackler 143206d54d Stabilize RangeArgument
Move it and Bound to core::ops while we're at it.

Closes #30877
2017-06-24 19:20:57 -07:00
Steven Fackler dc411e307a Stabilize ThreadId
Closes #21507
2017-06-24 19:19:26 -07:00
Steven Fackler ea4fb8ee27 Stabilize OsString::shrink_to_fit
Closes #40421
2017-06-24 19:19:26 -07:00
Steven Fackler 05cbdb1bad Stabilize cmp::Reverse
Closes #40893
2017-06-24 19:19:26 -07:00
Steven Fackler 14c2f99f80 Stabilize Command::envs
Closes #38526
2017-06-24 19:19:26 -07:00
Paul Woolcock 8edc3cae3b Add compile-fail test for the new feature gate 2017-06-24 18:41:05 -04:00
bors bc9822af2e 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.
2017-06-24 22:34:08 +00:00
Guillaume Gomez 9137153e47 Use new macro instead 2017-06-24 21:28:11 +02:00
Guillaume Gomez deb1eb6134 wording improvement 2017-06-24 21:28:08 +02:00
Guillaume Gomez 7b8c6a2d30 Add E0607 2017-06-24 21:27:49 +02:00
Guillaume Gomez 30effc14e4 Add E0606 2017-06-24 21:27:45 +02:00