]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #44449 - tommyip:doc_string_as_str, r=frewsxcv
Guillaume Gomez [Sun, 10 Sep 2017 12:03:28 +0000 (14:03 +0200)]
Rollup merge of #44449 - tommyip:doc_string_as_str, r=frewsxcv

Add doc example to String::as_str

Fixes #44428.

6 years agoRollup merge of #44396 - joshlf:tls-comment, r=alexcrichton
Guillaume Gomez [Sun, 10 Sep 2017 12:03:27 +0000 (14:03 +0200)]
Rollup merge of #44396 - joshlf:tls-comment, r=alexcrichton

std::thread::LocalKey: Document limitation with initializers

Document that if a `LocalKey`'s initializer recursively depends on itself, initialization will result in infinite recursion.

6 years agoRollup merge of #44387 - est31:update_compiler_builtins, r=Mark-Simulacrum
Guillaume Gomez [Sun, 10 Sep 2017 12:03:26 +0000 (14:03 +0200)]
Rollup merge of #44387 - est31:update_compiler_builtins, r=Mark-Simulacrum

Update the libcompiler_builins submodule

Pulls in https://github.com/rust-lang-nursery/compiler-builtins/pull/187 for nicer build output :)

6 years agoRollup merge of #44384 - alexcrichton:osx-segfault, r=estebank
Guillaume Gomez [Sun, 10 Sep 2017 12:03:25 +0000 (14:03 +0200)]
Rollup merge of #44384 - alexcrichton:osx-segfault, r=estebank

std: Fix a segfault on OSX with backtraces

Apparently `dladdr` can succeed but still give you NULL pointers!

Closes #44379

6 years agoRollup merge of #44372 - bgermann:master, r=alexcrichton
Guillaume Gomez [Sun, 10 Sep 2017 12:03:24 +0000 (14:03 +0200)]
Rollup merge of #44372 - bgermann:master, r=alexcrichton

Use memalign instead of posix_memalign for Solaris

As pointed out in https://github.com/rust-lang/libc/commit/deb61c8,
Solaris 10 does not support posix_memalign.
Use memalign for all Solaris versions instead.
With this change applied I am able to cross-build rustc for Solaris 10.

6 years agoRollup merge of #44347 - GuillaumeGomez:rustdoc-false-positive, r=QuietMisdreavus
Guillaume Gomez [Sun, 10 Sep 2017 12:03:23 +0000 (14:03 +0200)]
Rollup merge of #44347 - GuillaumeGomez:rustdoc-false-positive, r=QuietMisdreavus

Reduce false positives number in rustdoc html diff

cc @rust-lang/dev-tools
r? @nrc

Very simple trick but should lighten html diff a bit

6 years agoRollup merge of #44332 - tirr-c:issue-44021, r=petrochenkov
Guillaume Gomez [Sun, 10 Sep 2017 12:03:22 +0000 (14:03 +0200)]
Rollup merge of #44332 - tirr-c:issue-44021, r=petrochenkov

Expect pipe symbol after closure parameter list

Fixes #44021.

---

Originally, the parser just called `bump` to discard following token after parsing closure parameter list, because it assumes `|` is following. However, the following code breaks the assumption:

```rust
struct MyStruct;
impl MyStruct {
   fn f() {|x, y}
}
```

Here, the parameter list is `x, y` and the following token is `}`. The parser discards `}`, and then we have a curly bracket mismatch.

Indeed, this code has a syntax error. On current nightly, the compiler emits an syntax error, but with incorrect message and span, followed by an ICE.

```
error: expected expression, found `}`
 --> 44021.rs:4:1
  |
4 | }
  | ^

error: internal compiler error: unexpected panic
```

Even worse, on current stable(1.20.0), the compiler falls into an infinite loop.

This pull request fixes this problem. Now the compiler emits correct error message and span, and does not ICE.

```
error: expected one of `:`, `@`, or `|`, found `}`
 --> 44021.rs:3:20
  |
3 |     fn foo() {|x, y}
  |                    ^ expected one of `:`, `@`, or `|` here
```

6 years agoRollup merge of #44329 - nrc:pulldown-warn-fix, r=ollie27
Guillaume Gomez [Sun, 10 Sep 2017 12:03:21 +0000 (14:03 +0200)]
Rollup merge of #44329 - nrc:pulldown-warn-fix, r=ollie27

Fixup some nits from #44238

r? @ollie27

6 years agoRollup merge of #44262 - alexcrichton:repr-128-gate, r=nikomatsakis
Guillaume Gomez [Sun, 10 Sep 2017 12:03:20 +0000 (14:03 +0200)]
Rollup merge of #44262 - alexcrichton:repr-128-gate, r=nikomatsakis

rustc: Separately feature gate repr(i128)

Brought up during the discussion of #35118, the support for this is still
somewhat buggy and so stabilization likely wants to be considered independently
of the type itself.

6 years agoAuto merge of #44418 - alexcrichton:remove-dep-graph, r=michaelwoerister
bors [Sun, 10 Sep 2017 07:33:46 +0000 (07:33 +0000)]
Auto merge of #44418 - alexcrichton:remove-dep-graph, r=michaelwoerister

rustc: Remove `DepGraph` handling from rustc_metadata

This should now be entirely tracked through queries, so no need to have a
`DepGraph` in the `CStore` object any more!

cc #44390

6 years agoAuto merge of #44260 - alexcrichton:hardlink-no-copy, r=Mark-Simulacrum
bors [Sun, 10 Sep 2017 04:36:15 +0000 (04:36 +0000)]
Auto merge of #44260 - alexcrichton:hardlink-no-copy, r=Mark-Simulacrum

rustbuild: Switch back to using hard links

The `copy` function historically in rustbuild used hard links to speed up the
copy operations that it does. This logic was backed out, however, in #39518 due
to a bug that only showed up on Windows, described in #39504. The cause
described in #39504 happened because Cargo, on a fresh build, would overwrite
the previous artifacts with new hard links that Cargo itself manages.

This behavior in Cargo was fixed in rust-lang/cargo#4390 where it no longer
should overwrite files on fresh builds, opportunistically leaving the filesystem
intact and not touching it.

Hopefully this can help speed up local builds by doing fewer copies all over the
place!

6 years agorustbuild: Switch back to using hard links
Alex Crichton [Sat, 2 Sep 2017 03:46:51 +0000 (20:46 -0700)]
rustbuild: Switch back to using hard links

The `copy` function historically in rustbuild used hard links to speed up the
copy operations that it does. This logic was backed out, however, in #39518 due
to a bug that only showed up on Windows, described in #39504. The cause
described in #39504 happened because Cargo, on a fresh build, would overwrite
the previous artifacts with new hard links that Cargo itself manages.

This behavior in Cargo was fixed in rust-lang/cargo#4390 where it no longer
should overwrite files on fresh builds, opportunistically leaving the filesystem
intact and not touching it.

Hopefully this can help speed up local builds by doing fewer copies all over the
place!

6 years agorustc: Remove `DepGraph` handling from rustc_metadata
Alex Crichton [Thu, 7 Sep 2017 19:35:21 +0000 (12:35 -0700)]
rustc: Remove `DepGraph` handling from rustc_metadata

This should now be entirely tracked through queries, so no need to have a
`DepGraph` in the `CStore` object any more!

6 years agoAuto merge of #44274 - Mark-Simulacrum:rustdoc-tests, r=alexcrichton
bors [Sun, 10 Sep 2017 01:24:14 +0000 (01:24 +0000)]
Auto merge of #44274 - Mark-Simulacrum:rustdoc-tests, r=alexcrichton

Test rustdoc.

Also fixes the broken tests.

r? @alexcrichton

6 years agoAuto merge of #44251 - kennytm:osx-backtrace, r=alexcrichton
bors [Sat, 9 Sep 2017 17:32:13 +0000 (17:32 +0000)]
Auto merge of #44251 - kennytm:osx-backtrace, r=alexcrichton

Add libbacktrace support for Apple platforms (resubmitted)

Resubmitting #43422 rebased on the current master (cc @JohnColanduoni).

I have added an additional commit to fallback to `dladdr`-based `resolve_symbol` if `libbacktrace` returns `None`, otherwise the stack trace will be full of `<unknown>` when you forget to pass the `-g` flag (actually it seems — at least on macOS — the `dladdr` symbol is more accurate than the `libbacktrace` one).

6 years agoAuto merge of #44212 - eddyb:drop-const, r=nikomatsakis
bors [Sat, 9 Sep 2017 11:48:57 +0000 (11:48 +0000)]
Auto merge of #44212 - eddyb:drop-const, r=nikomatsakis

Allow Drop types in const's too, with #![feature(drop_types_in_const)].

Implements the remaining amendment, see #33156. cc @SergioBenitez

r? @nikomatsakis

6 years agoAuto merge of #44438 - Xaeroxe:clamp, r=Mark-Simulacrum
bors [Sat, 9 Sep 2017 09:13:03 +0000 (09:13 +0000)]
Auto merge of #44438 - Xaeroxe:clamp, r=Mark-Simulacrum

Revert clamp

Revert clamp per https://github.com/rust-lang/rust/issues/44095#issuecomment-328218316 while we take time to assess the potential backwards compatibility damage done by it.

6 years agoAdd doc example to String::as_str
Tommy Ip [Sat, 9 Sep 2017 08:05:54 +0000 (09:05 +0100)]
Add doc example to String::as_str

Fixes #44428.

6 years agoAuto merge of #44335 - arielb1:node-hashing, r=alexcrichton
bors [Sat, 9 Sep 2017 05:58:13 +0000 (05:58 +0000)]
Auto merge of #44335 - arielb1:node-hashing, r=alexcrichton

Avoid hashing when creating a DepNode from a HirId

Instead, combine the already-present DefPathHash with the 32-bit
ItemLocalIndex.

Should fix #44323.

r? @alexcrichton

6 years agoAuto merge of #44269 - nikomatsakis:issue-43613-limit-cache-obligations, r=arielb1
bors [Fri, 8 Sep 2017 23:47:16 +0000 (23:47 +0000)]
Auto merge of #44269 - nikomatsakis:issue-43613-limit-cache-obligations, r=arielb1

limit and clear cache obligations opportunistically

Keeping **all** the obligations for every projection is wasteful of
memory and compilation time. We only really care about those
subobligations that may inform the result of the projection (i.e., may
help to resolve any inference variables that appear within).
Therefore, we can clear the subobligations from the cache that don't
potentially affect the result of the projection. On every cache hit,
we also take the opportunity to check if the type variables have been
resolved *yet* and, if so, clear out the pending obligations.

Fixes #43613.

r? @arielb1

NB -- not sure how to test for this. Probably we should add the #43613 test case to perf.

6 years agoRevert "Add clamp functions"
Jacob Kiesel [Fri, 8 Sep 2017 22:07:21 +0000 (16:07 -0600)]
Revert "Add clamp functions"

This reverts commit c589f867f89d4e6e48c6602aed8e878208d4822f.

6 years agoRevert "Add NAN examples"
Jacob Kiesel [Fri, 8 Sep 2017 22:07:19 +0000 (16:07 -0600)]
Revert "Add NAN examples"

This reverts commit f74c5d2e18e50c24de2cc1192bf2088cdaa61916.

6 years agoRevert "Fix f32 examples."
Jacob Kiesel [Fri, 8 Sep 2017 22:07:17 +0000 (16:07 -0600)]
Revert "Fix f32 examples."

This reverts commit 61f20f8df02e53ee60dc1719ce0e502eecebf8b4.

6 years agoRevert "Fix f64 examples"
Jacob Kiesel [Fri, 8 Sep 2017 22:07:15 +0000 (16:07 -0600)]
Revert "Fix f64 examples"

This reverts commit 576426a05a1a6cb33eece7082d7341b7c6bb5277.

6 years agoRevert "Fix documentation and formatting."
Jacob Kiesel [Fri, 8 Sep 2017 22:07:13 +0000 (16:07 -0600)]
Revert "Fix documentation and formatting."

This reverts commit 2e34ff767113c6a15c5862b0646ca9ad7ffd81b1.

6 years agoRevert "Add panic unit tests"
Jacob Kiesel [Fri, 8 Sep 2017 22:07:09 +0000 (16:07 -0600)]
Revert "Add panic unit tests"

This reverts commit b762283e57ff71f6763effb9cfc7fc0c7967b6b0.

6 years agoAuto merge of #44142 - alexcrichton:dllimport-query, r=nikomatsakis
bors [Fri, 8 Sep 2017 09:47:58 +0000 (09:47 +0000)]
Auto merge of #44142 - alexcrichton:dllimport-query, r=nikomatsakis

Migrate a slew of metadata methods to queries

This PR intends to make more progress on #41417, knocking off some low-hanging fruit.

Closes #44190
cc #44137

6 years agoAuto merge of #43742 - epdtry:pprust-expr-fix, r=petrochenkov
bors [Fri, 8 Sep 2017 06:56:09 +0000 (06:56 +0000)]
Auto merge of #43742 - epdtry:pprust-expr-fix, r=petrochenkov

pprust: fix parenthesization of exprs

The pretty printer in `syntax::print::pprust` currently relies on the presence of `ExprKind::Paren` hints in order to correctly parenthesize expressions in its output.  If `Paren` nodes are missing, it sometimes produces wrong output, such as printing `1 - (2 - 3)` as `1 - 2 - 3`.  This PR fixes `pprust` to correctly print expressions regardless of the presence or absence of `Paren` nodes.  This should make `pprust` easier to use with programmatically constructed ASTs.

A few notes:

 * I added a function for assigning precedence values to exprs in `syntax::util::parser`, since there is already code there for assigning precedence values to binops.  Let me know if I should move this somewhere more `pprust`-specific.

 * I also moved the `contains_exterior_struct_lit` function from `rustc_lint::unused::UnusedParens` into `syntax::util::parser`, since it's needed for determining the correct parenthesization of `if`/`while` conditional expressions.

 * I couldn't find a good way to compare two exprs for equivalence while ignoring semantically-irrelevant details like spans.  So the test for the new behavior relies on a slight hack: it adds `Paren` nodes everywhere, so that the pretty-printed version exactly reflects the structure of the AST, and then compares the printed strings.  This works, but let me know if there's a better way.

6 years agoAuto merge of #44399 - alexcrichton:tmp-travis-downgrade, r=alexcrichton
bors [Thu, 7 Sep 2017 22:45:48 +0000 (22:45 +0000)]
Auto merge of #44399 - alexcrichton:tmp-travis-downgrade, r=alexcrichton

travis: Downgrade to previous images temporarily

Travis is in the process of [rolling out an update][update] but looks like our
tests are breaking, let's temporarily roll back to get the queue moving again.

[update]: https://blog.travis-ci.com/2017-08-29-trusty-image-updates

6 years agotravis: Downgrade to previous images temporarily
Alex Crichton [Thu, 7 Sep 2017 20:48:35 +0000 (13:48 -0700)]
travis: Downgrade to previous images temporarily

Travis is in the process of [rolling out an update][update] but looks like our
tests are breaking, let's temporarily roll back to get the queue moving again.

[update]: https://blog.travis-ci.com/2017-08-29-trusty-image-updates

6 years agostd::thread::LocalKey: Document limitation with initializers
Joshua Liebow-Feeser [Thu, 7 Sep 2017 19:57:08 +0000 (12:57 -0700)]
std::thread::LocalKey: Document limitation with initializers

6 years agoupdate comment
Niko Matsakis [Thu, 7 Sep 2017 16:38:33 +0000 (12:38 -0400)]
update comment

6 years agorustc: Remove `CrateStore::crates` as a method
Alex Crichton [Thu, 7 Sep 2017 15:13:41 +0000 (08:13 -0700)]
rustc: Remove `CrateStore::crates` as a method

This commit moves the `crates` method to a query and then migrates all callers
to use a query instead of the now-renamed `crates_untracked` method where
possible.

Closes #41417

6 years agoAdd some more with_ignore to get tests passing
Alex Crichton [Thu, 7 Sep 2017 14:21:49 +0000 (07:21 -0700)]
Add some more with_ignore to get tests passing

6 years agopprust: increase precedence of block-like exprs
Stuart Pernsteiner [Thu, 7 Sep 2017 14:28:31 +0000 (10:28 -0400)]
pprust: increase precedence of block-like exprs

6 years agoAuto merge of #44249 - pnkfelix:debugflag-emit-end-regions, r=arielb1
bors [Thu, 7 Sep 2017 13:06:12 +0000 (13:06 +0000)]
Auto merge of #44249 - pnkfelix:debugflag-emit-end-regions, r=arielb1

Debugflag: -Z emit-end-regions

 Skip EndRegion emission by default. Use `-Z emit-end-regions` to reenable it.

The main intent is to fix cases where `EndRegion` emission is believed to be causing excess peak memory pressure.

It may also be a welcome change to people inspecting the MIR output who find the EndRegions to be a distraction.

(In later follow-up PR's I will put in safe-guards against using the current mir-borrowck without enabling `EndRegion` emission. But I wanted this PR to be minimal, in part because we may wish to backport it to the beta channel if we find that it reduces peak memory usage significantly.)

6 years agoUpdate the libcompiler_builins submodule
est31 [Thu, 7 Sep 2017 07:07:44 +0000 (09:07 +0200)]
Update the libcompiler_builins submodule

Pulls in https://github.com/rust-lang-nursery/compiler-builtins/pull/187 for nicer build output :)

6 years agoAuto merge of #43931 - eddyb:const-local-key, r=alexcrichton
bors [Thu, 7 Sep 2017 06:52:05 +0000 (06:52 +0000)]
Auto merge of #43931 - eddyb:const-local-key, r=alexcrichton

Make the LocalKey facade of thread_local! inlineable cross-crate.

Fixes (almost*) #25088 by changing the `LocalKey` `static` `thread_local!` generates to a `const`.
This can be done because a `LocalKey` value holds no actual TLS data, only function pointers to get at said data, and it could even be made `Copy` without any negative consequences.
The recent stabilization of rvalue promotion to `'static` allows doing this without changing the API.
r? @alexcrichton

*almost because we can't yet inline `__getit` because it breaks on MSVC, see https://github.com/rust-lang/rust/pull/43931#issuecomment-323534214

6 years agostd: Fix a segfault on OSX with backtraces
Alex Crichton [Thu, 7 Sep 2017 05:13:59 +0000 (22:13 -0700)]
std: Fix a segfault on OSX with backtraces

Apparently `dladdr` can succeed but still give you NULL pointers!

Closes #44379

6 years agoAuto merge of #44094 - alexcrichton:long-linkers, r=michaelwoerister
bors [Thu, 7 Sep 2017 04:07:09 +0000 (04:07 +0000)]
Auto merge of #44094 - alexcrichton:long-linkers, r=michaelwoerister

rustc: Attempt to handle super long linker invocations

This commit adds logic to the compiler to attempt to handle super long linker
invocations by falling back to the `@`-file syntax if the invoked command is too
large. Each OS has a limit on how many arguments and how large the arguments can
be when spawning a new process, and linkers tend to be one of those programs
that can hit the limit!

The logic implemented here is to unconditionally attempt to spawn a linker and
then if it fails to spawn with an error from the OS that indicates the command
line is too big we attempt a fallback. The fallback is roughly the same for all
linkers where an argument pointing to a file, prepended with `@`, is passed.
This file then contains all the various arguments that we want to pass to the
linker.

Closes #41190

6 years agoAuto merge of #44380 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Thu, 7 Sep 2017 01:04:34 +0000 (01:04 +0000)]
Auto merge of #44380 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 23 pull requests

- Successful merges: #44097, #44206, #44218, #44276, #44277, #44296, #44303, #44313, #44315, #44317, #44319, #44321, #44325, #44326, #44327, #44328, #44330, #44351, #44353, #44354, #44361, #44362, #44377
- Failed merges:

6 years agoRollup merge of #44377 - mathstuf:config.toml-typos, r=alexcrichton
Mark Simulacrum [Thu, 7 Sep 2017 00:28:08 +0000 (18:28 -0600)]
Rollup merge of #44377 - mathstuf:config.toml-typos, r=alexcrichton

config.toml.example: fix some typos

6 years agoRollup merge of #44362 - oli-obk:patch-7, r=eddyb
Mark Simulacrum [Thu, 7 Sep 2017 00:28:07 +0000 (18:28 -0600)]
Rollup merge of #44362 - oli-obk:patch-7, r=eddyb

Fix a bug in the inliner

r? @eddyb

6 years agoRollup merge of #44361 - oli-obk:lit_sugg, r=nikomatsakis
Mark Simulacrum [Thu, 7 Sep 2017 00:28:06 +0000 (18:28 -0600)]
Rollup merge of #44361 - oli-obk:lit_sugg, r=nikomatsakis

Suggest changing literals instead of calling methods (fixes #44307)

6 years agoRollup merge of #44354 - jakllsch:jakllsch-85453197-a0cc-43f6-8c55-7bce6c4a4ebf,...
Mark Simulacrum [Thu, 7 Sep 2017 00:28:05 +0000 (18:28 -0600)]
Rollup merge of #44354 - jakllsch:jakllsch-85453197-a0cc-43f6-8c55-7bce6c4a4ebf, r=Mark-Simulacrum

bootstrap: openssl for NetBSD/sparc64 in extended build

r? @Mark-Simulacrum

6 years agoRollup merge of #44353 - cuviper:install-rustc, r=Mark-Simulacrum
Mark Simulacrum [Thu, 7 Sep 2017 00:28:04 +0000 (18:28 -0600)]
Rollup merge of #44353 - cuviper:install-rustc, r=Mark-Simulacrum

Include rustc in the default `./x.py install`

The default install used to include rustc, rust-std, and rust-docs, but
the refactoring in commit 6b3413d825fa6 make rustc only default in
extended builds.  This commit makes rustc installed by default again.

6 years agoRollup merge of #44351 - lu-zero:master, r=nikomatsakis
Mark Simulacrum [Thu, 7 Sep 2017 00:28:03 +0000 (18:28 -0600)]
Rollup merge of #44351 - lu-zero:master, r=nikomatsakis

More PowerPC Altivec intrinsics

6 years agoRollup merge of #44330 - WiSaGaN:patch-1, r=aturon
Mark Simulacrum [Thu, 7 Sep 2017 00:28:02 +0000 (18:28 -0600)]
Rollup merge of #44330 - WiSaGaN:patch-1, r=aturon

Fix link typo in 1.20.0 release notes

Should have been included in https://github.com/rust-lang/rust/pull/44230

6 years agoRollup merge of #44328 - mcomstock:from-str-doc-fix, r=steveklabnik
Mark Simulacrum [Thu, 7 Sep 2017 00:28:00 +0000 (18:28 -0600)]
Rollup merge of #44328 - mcomstock:from-str-doc-fix, r=steveklabnik

Removed the incorrect documentation for from_str

Fixes #44242.

6 years agoRollup merge of #44327 - Eh2406:FIXME#12808, r=aturon
Mark Simulacrum [Thu, 7 Sep 2017 00:27:59 +0000 (18:27 -0600)]
Rollup merge of #44327 - Eh2406:FIXME#12808, r=aturon

#12808 is closed remove the FIXME

let's see if this can be cleaned up.

https://github.com/rust-lang/rust/issues/12808#issuecomment-326852052

6 years agoRollup merge of #44326 - Eh2406:FIXME#44590, r=arielb1
Mark Simulacrum [Thu, 7 Sep 2017 00:27:58 +0000 (18:27 -0600)]
Rollup merge of #44326 - Eh2406:FIXME#44590, r=arielb1

#33490 is closed remove the FIXME

let's see if this can be cleaned up.

https://github.com/rust-lang/rust/issues/33490#issuecomment-326851930

6 years agoRollup merge of #44325 - nielsegberts:master, r=steveklabnik
Mark Simulacrum [Thu, 7 Sep 2017 00:27:57 +0000 (18:27 -0600)]
Rollup merge of #44325 - nielsegberts:master, r=steveklabnik

Make slice::split_at_mut example demonstrate mutability

Moved the examples from split_at_mut to split_at so the example at
split_at_mut can just demonstrate mutability.

See #44314

r? @steveklabnik

6 years agoRollup merge of #44321 - jakllsch:jakllsch-4f2d6c87-2674-43e4-9c5f-2415136e6bdc,...
Mark Simulacrum [Thu, 7 Sep 2017 00:27:56 +0000 (18:27 -0600)]
Rollup merge of #44321 - jakllsch:jakllsch-4f2d6c87-2674-43e4-9c5f-2415136e6bdc, r=Mark-Simulacrum

bootstrap: only include docs in extended distribution if enabled

Fixes #44163

6 years agoRollup merge of #44319 - est31:master, r=eddyb
Mark Simulacrum [Thu, 7 Sep 2017 00:27:55 +0000 (18:27 -0600)]
Rollup merge of #44319 - est31:master, r=eddyb

Improve DefIndex formatting to be more semantic

Fixes #44318

r? @eddyb

6 years agoRollup merge of #44317 - Dushistov:master, r=arielb1
Mark Simulacrum [Thu, 7 Sep 2017 00:27:54 +0000 (18:27 -0600)]
Rollup merge of #44317 - Dushistov:master, r=arielb1

Add test for #22706

Closes #22706

6 years agoRollup merge of #44315 - kallisti5:epoch-doc-example-squashed, r=GuillaumeGomez
Mark Simulacrum [Thu, 7 Sep 2017 00:27:53 +0000 (18:27 -0600)]
Rollup merge of #44315 - kallisti5:epoch-doc-example-squashed, r=GuillaumeGomez

std/time: Give an example to get UNIX_EPOCH in seconds

6 years agoRollup merge of #44313 - RalfJung:book, r=nikomatsakis
Mark Simulacrum [Thu, 7 Sep 2017 00:27:52 +0000 (18:27 -0600)]
Rollup merge of #44313 - RalfJung:book, r=nikomatsakis

rustbook: remove dead test functions

There is no "test" subcommand added to the `clap::App`, so this is all dead code.

Cc @steveklabnik -- your [commit](https://github.com/RalfJung/rust/commit/a076961fd0e3d8a68f8b047460b8f5191d203b08) introducing this stated the intention of having both commands, but it seems nobody has missed the `test` command since February.

6 years agoRollup merge of #44303 - clarcharr:debugs, r=alexcrichton
Mark Simulacrum [Thu, 7 Sep 2017 00:27:51 +0000 (18:27 -0600)]
Rollup merge of #44303 - clarcharr:debugs, r=alexcrichton

impl Debug for SplitWhitespace.

This one got missed because `libstd_unicode` doesn't have a `deny(missing_debug_implementations)` like `libstd` and `libcore`. I think that perhaps this lint should check for items exported from other crates too.

6 years agoRollup merge of #44296 - zmanian:patch-1, r=steveklabnik
Mark Simulacrum [Thu, 7 Sep 2017 00:27:50 +0000 (18:27 -0600)]
Rollup merge of #44296 - zmanian:patch-1, r=steveklabnik

Minor documentation improvements for StmtKind

Documentation for Semi and Marco StmtKinds.

Wasn't obvious to me what these were when writing a lint recently.

6 years agoRollup merge of #44277 - mattico:test-33185, r=nikomatsakis
Mark Simulacrum [Thu, 7 Sep 2017 00:27:49 +0000 (18:27 -0600)]
Rollup merge of #44277 - mattico:test-33185, r=nikomatsakis

Add test for #33185

Closes #33185

6 years agoRollup merge of #44276 - mattico:test-35376, r=alexcrichton
Mark Simulacrum [Thu, 7 Sep 2017 00:27:48 +0000 (18:27 -0600)]
Rollup merge of #44276 - mattico:test-35376, r=alexcrichton

Add test for #35676

Closes #35676

6 years agoRollup merge of #44218 - SimonSapin:commit-hash, r=alexcrichton
Mark Simulacrum [Thu, 7 Sep 2017 00:27:47 +0000 (18:27 -0600)]
Rollup merge of #44218 - SimonSapin:commit-hash, r=alexcrichton

Add full git commit hash to release channel manifests

The full hash is necessary to build the download URL for "alternate" compiler builds. This is a first step for https://github.com/rust-lang-nursery/rustup.rs/issues/1099.

6 years agoRollup merge of #44206 - MarkMcCaskey:master, r=steveklabnik
Mark Simulacrum [Thu, 7 Sep 2017 00:27:46 +0000 (18:27 -0600)]
Rollup merge of #44206 - MarkMcCaskey:master, r=steveklabnik

update unimplemented! docs

For #42628 (updating docs from changes from #42155).

Initial changes made to make `unimplemented!` doc comments look more like `unreachable!` and remove statement about the panic message.

r? @steveklabnik

6 years agoRollup merge of #44097 - Xaeroxe:clamp, r=burntsushi
Mark Simulacrum [Thu, 7 Sep 2017 00:27:45 +0000 (18:27 -0600)]
Rollup merge of #44097 - Xaeroxe:clamp, r=burntsushi

Add clamp functions

Implementation of clamp feature:

Tracking issue: https://github.com/rust-lang/rust/issues/44095
RFC: https://github.com/rust-lang/rfcs/pull/1961

6 years agoconfig.toml.example: fix some typos
Ben Boeckel [Wed, 6 Sep 2017 22:22:32 +0000 (18:22 -0400)]
config.toml.example: fix some typos

6 years agoadd in a "paranoid" trait bound
Niko Matsakis [Wed, 6 Sep 2017 21:54:37 +0000 (17:54 -0400)]
add in a "paranoid" trait bound

6 years agoUse memalign instead of posix_memalign for Solaris
bgermann [Wed, 6 Sep 2017 19:31:19 +0000 (21:31 +0200)]
Use memalign instead of posix_memalign for Solaris

As pointed out in https://github.com/rust-lang/libc/commit/deb61c8,
Solaris 10 does not support posix_memalign.
Use memalign for all Solaris versions instead.
With this change applied I am able to cross-build rustc for Solaris 10.

6 years agoAuto merge of #43975 - RalfJung:gcc, r=alexcrichton
bors [Wed, 6 Sep 2017 19:28:36 +0000 (19:28 +0000)]
Auto merge of #43975 - RalfJung:gcc, r=alexcrichton

use gcc::Build rather than deprecated gcc::Config

I did `cargo update -p gcc` to upgrade only this package. Is there further process that should be follwoed when updating a build dependency from crates.io?

r? @alexcrichton
Fixes #43973

6 years agohir::print: fix parenthesization of exprs
Stuart Pernsteiner [Mon, 14 Aug 2017 22:27:20 +0000 (18:27 -0400)]
hir::print: fix parenthesization of exprs

6 years agobetter explanatory comment for the pprust-expr-roundtrip test
Stuart Pernsteiner [Mon, 14 Aug 2017 22:26:55 +0000 (18:26 -0400)]
better explanatory comment for the pprust-expr-roundtrip test

6 years agopprust: fix parenthesization of exprs
Stuart Pernsteiner [Thu, 20 Jul 2017 20:53:56 +0000 (16:53 -0400)]
pprust: fix parenthesization of exprs

6 years agoAuto merge of #43849 - QuietMisdreavus:foreign-impls, r=steveklabnik
bors [Wed, 6 Sep 2017 11:24:18 +0000 (11:24 +0000)]
Auto merge of #43849 - QuietMisdreavus:foreign-impls, r=steveklabnik

rustdoc: add new "Implementations on Foreign Types" section to traits

Demo screenshot:

![image](https://user-images.githubusercontent.com/5217170/29281219-c547f758-80e3-11e7-808f-49f592c65c5b.png)

Full demo available at https://tonberry.quietmisdreavus.net/foreign-test/foreign_test/trait.CheckIt.html

This PR splits the "Implementors" section on trait pages into two: First, for impls on types local to the crate, their impls are kept as-is, printing one line for the impl line, and any additional lines for associated types. However, for types external to the crate, they are now pulled up over the others and are printed (almost) like the summary impl on the type page itself. This gives any doc comments on these impls or methods to be exposed in the documentation.

There's just one small problem, though: [libstd docs apparently surface impls for libc and rand, possibly among others](https://tonberry.quietmisdreavus.net/foreign-std/std/marker/trait.Copy.html#foreign-impls). This adds this section to pages in the std docs where we might not want them to show up in the first place. I think this is a bug distinct from this PR, but it does make it drastically apparent.

~~My question, then, is this: Do we want this here? Taking it out involves fixing which impls are visible to rustdoc, possibly specifically when rendering the std facade. I'm convinced this is fine to land as-is, since it adds a feature specifically for non-std crates (i'm thinking of things like `num` or related crates that implement things on primitives or std types as part of their functionality).~~ (EDIT: I have an open PR to fix this: https://github.com/rust-lang/rust/pull/44026)

6 years agoReintroduce the early returns
Oliver Schneider [Wed, 6 Sep 2017 10:25:46 +0000 (12:25 +0200)]
Reintroduce the early returns

6 years agoFix a bug in the inliner
Oliver Schneider [Wed, 6 Sep 2017 08:33:53 +0000 (10:33 +0200)]
Fix a bug in the inliner

6 years agoSuggest changing literals instead of calling methods (fixes #44307)
Oliver Schneider [Wed, 6 Sep 2017 08:09:25 +0000 (10:09 +0200)]
Suggest changing literals instead of calling methods (fixes #44307)

6 years agoReduce false positives number in rustdoc html diff
Guillaume Gomez [Tue, 5 Sep 2017 18:54:01 +0000 (20:54 +0200)]
Reduce false positives number in rustdoc html diff

6 years agorustc: Attempt to handle super long linker invocations
Alex Crichton [Sat, 26 Aug 2017 03:16:51 +0000 (20:16 -0700)]
rustc: Attempt to handle super long linker invocations

This commit adds logic to the compiler to attempt to handle super long linker
invocations by falling back to the `@`-file syntax if the invoked command is too
large. Each OS has a limit on how many arguments and how large the arguments can
be when spawning a new process, and linkers tend to be one of those programs
that can hit the limit!

The logic implemented here is to unconditionally attempt to spawn a linker and
then if it fails to spawn with an error from the OS that indicates the command
line is too big we attempt a fallback. The fallback is roughly the same for all
linkers where an argument pointing to a file, prepended with `@`, is passed.
This file then contains all the various arguments that we want to pass to the
linker.

Closes #41190

6 years agoRemove trailing white space
Zaki Manian [Wed, 6 Sep 2017 01:46:21 +0000 (18:46 -0700)]
Remove trailing white space

6 years agoAuto merge of #43426 - qnighy:intercrate-ambiguity-hints, r=nikomatsakis
bors [Wed, 6 Sep 2017 00:28:15 +0000 (00:28 +0000)]
Auto merge of #43426 - qnighy:intercrate-ambiguity-hints, r=nikomatsakis

Add hints when intercrate ambiguity causes overlap.

I'm going to tackle #23980.

# Examples

## Trait impl overlap caused by possible downstream impl

```rust
trait Foo<X> {}
trait Bar<X> {}
impl<X, T> Foo<X> for T where T: Bar<X> {}
impl<X> Foo<X> for i32 {}

fn main() {}
```

```
error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`:
 --> test1.rs:4:1
  |
3 | impl<X, T> Foo<X> for T where T: Bar<X> {}
  | ------------------------------------------ first implementation here
4 | impl<X> Foo<X> for i32 {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32`
  |
  = note: downstream crates may implement Bar

error: aborting due to previous error
```

## Trait impl overlap caused by possible upstream update

```rust
trait Foo {}
impl<T> Foo for T where T: ::std::fmt::Octal {}
impl Foo for () {}

fn main() {}
```

```
error[E0119]: conflicting implementations of trait `Foo` for type `()`:
 --> test2.rs:3:1
  |
2 | impl<T> Foo for T where T: ::std::fmt::Octal {}
  | ----------------------------------------------- first implementation here
3 | impl Foo for () {}
  | ^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
  |
  = note: upstream crates may add new impl for std::fmt::Octal in future versions

error: aborting due to previous error
```

## Inherent impl overlap caused by possible downstream impl

```rust
trait Bar<X> {}

struct A<T, X>(T, X);
impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
impl<X> A<i32, X> { fn f(&self) {} }

fn main() {}
```

```
error[E0592]: duplicate definitions with name `f`
 --> test3.rs:4:38
  |
4 | impl<X, T> A<T, X> where T: Bar<X> { fn f(&self) {} }
  |                                      ^^^^^^^^^^^^^^ duplicate definitions for `f`
5 | impl<X> A<i32, X> { fn f(&self) {} }
  |                     -------------- other definition for `f`
  |
  = note: downstream crates may implement Bar

error: aborting due to previous error
```

## Inherent impl overlap caused by possible upstream update

```rust
struct A<T>(T);

impl<T> A<T> where T: ::std::fmt::Octal { fn f(&self) {} }
impl A<()> { fn f(&self) {} }

fn main() {}
```

```
error[E0592]: duplicate definitions with name `f`
 --> test4.rs:3:43
  |
3 | impl<T> A<T> where T: ::std::fmt::Octal { fn f(&self) {} }
  |                                           ^^^^^^^^^^^^^^ duplicate definitions for `f`
4 | impl A<()> { fn f(&self) {} }
  |              -------------- other definition for `f`
  |
  = note: upstream crates may add new impl for std::fmt::Octal in future versions

error: aborting due to previous error
```

6 years agobootstrap: avoid m4 -B for NetBSD-built sparc64 OpenSSL
Jonathan A. Kollasch [Thu, 31 Aug 2017 14:36:10 +0000 (09:36 -0500)]
bootstrap: avoid m4 -B for NetBSD-built sparc64 OpenSSL

6 years agobootstrap: add openssl config for sparc64-unknown-netbsd
Jonathan A. Kollasch [Thu, 31 Aug 2017 14:34:03 +0000 (09:34 -0500)]
bootstrap: add openssl config for sparc64-unknown-netbsd

6 years agoInclude rustc in the default `./x.py install`
Josh Stone [Tue, 5 Sep 2017 21:19:22 +0000 (14:19 -0700)]
Include rustc in the default `./x.py install`

The default install used to include rustc, rust-std, and rust-docs, but
the refactoring in commit 6b3413d825fa6 make rustc only default in
extended builds.  This commit makes rustc installed by default again.

6 years agoFixup some nits from #44238
Nick Cameron [Tue, 5 Sep 2017 04:16:48 +0000 (16:16 +1200)]
Fixup some nits from #44238

6 years agoAdd support for Vector Sum Saturated on PowerPC
Luca Barbato [Fri, 4 Aug 2017 00:19:58 +0000 (00:19 +0000)]
Add support for Vector Sum Saturated on PowerPC

6 years agoAdd support for Vector Sum Across Partial 1/4 Saturated on PowerPC
Luca Barbato [Fri, 4 Aug 2017 00:19:58 +0000 (00:19 +0000)]
Add support for Vector Sum Across Partial 1/4 Saturated on PowerPC

6 years agoAdd support for Vector Sum Across Partial 1/2 Saturated on PowerPC
Luca Barbato [Fri, 4 Aug 2017 00:19:58 +0000 (00:19 +0000)]
Add support for Vector Sum Across Partial 1/2 Saturated on PowerPC

6 years agoClarify failure condition on tests
Alex Crichton [Tue, 5 Sep 2017 18:55:01 +0000 (11:55 -0700)]
Clarify failure condition on tests

6 years agoMake git commit info optional and per-package in channel manifests
Simon Sapin [Mon, 4 Sep 2017 15:31:29 +0000 (17:31 +0200)]
Make git commit info optional and per-package in channel manifests

At the moment it is always missing for Cargo and RLS.
Their respective build systems need to be modified to include
`git-commit-hash` files in their "dist" tarballs.

6 years agoTest rustdoc unit tests.
Mark Simulacrum [Sat, 2 Sep 2017 14:02:32 +0000 (08:02 -0600)]
Test rustdoc unit tests.

Doc tests are temporarily disabled until next release cycle, since
current beta Cargo errors on them. Upgrade should be smooth as the
relevant tests are already fixed in this commit.

6 years agodisable gcc warnings
Ralf Jung [Tue, 5 Sep 2017 15:48:47 +0000 (17:48 +0200)]
disable gcc warnings

6 years agoadd "Implementations on Foreign Types" to the sidebar
QuietMisdreavus [Tue, 15 Aug 2017 21:05:03 +0000 (16:05 -0500)]
add "Implementations on Foreign Types" to the sidebar

6 years agoif not showing default docs on an impl, autohide the items
QuietMisdreavus [Mon, 14 Aug 2017 15:59:03 +0000 (10:59 -0500)]
if not showing default docs on an impl, autohide the items

6 years agorustdoc: add new "Implementations on Foreign Types" section to traits
QuietMisdreavus [Tue, 8 Aug 2017 20:22:04 +0000 (15:22 -0500)]
rustdoc: add new "Implementations on Foreign Types" section to traits

6 years agofactor out helper method
Niko Matsakis [Mon, 28 Aug 2017 20:50:41 +0000 (16:50 -0400)]
factor out helper method

6 years agoFix misdetection of upstream intercrate ambiguity.
Masaki Hara [Tue, 1 Aug 2017 08:07:11 +0000 (12:37 +0430)]
Fix misdetection of upstream intercrate ambiguity.

6 years agoAdd downstream tests for intercrate ambiguity hints.
Masaki Hara [Tue, 1 Aug 2017 06:53:02 +0000 (11:23 +0430)]
Add downstream tests for intercrate ambiguity hints.

6 years agoPrint more detailed trait-ref for intercrate ambiguity.
Masaki Hara [Tue, 1 Aug 2017 05:57:25 +0000 (10:27 +0430)]
Print more detailed trait-ref for intercrate ambiguity.

6 years agoUnify intercrate ambiguity emitters into a function.
Masaki Hara [Tue, 25 Jul 2017 07:52:36 +0000 (16:52 +0900)]
Unify intercrate ambiguity emitters into a function.

6 years agoFix a very subtle mistake in a ui test.
Masaki Hara [Tue, 25 Jul 2017 07:50:49 +0000 (16:50 +0900)]
Fix a very subtle mistake in a ui test.

6 years agoAdd tests for intercrate ambiguity hints.
Masaki Hara [Tue, 25 Jul 2017 06:46:26 +0000 (15:46 +0900)]
Add tests for intercrate ambiguity hints.