]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAdd doc example to String::as_mut_str
Tommy Ip [Sat, 9 Sep 2017 12:08:26 +0000 (13:08 +0100)]
Add doc example to String::as_mut_str

Fixes #44429.

6 years agoFix trailing whitespace
smt923 [Sun, 10 Sep 2017 13:08:20 +0000 (14:08 +0100)]
Fix trailing whitespace

6 years agoAuto merge of #44474 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 10 Sep 2017 12:48:55 +0000 (12:48 +0000)]
Auto merge of #44474 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 13 pull requests

- Successful merges: #44262, #44329, #44332, #44347, #44372, #44384, #44387, #44396, #44449, #44451, #44457, #44464, #44467
- Failed merges:

6 years agoRollup merge of #44467 - toidiu:ak-44382, r=frewsxcv
Guillaume Gomez [Sun, 10 Sep 2017 12:03:32 +0000 (14:03 +0200)]
Rollup merge of #44467 - toidiu:ak-44382, r=frewsxcv

documentation update to demonstrate mutability

#44467

- demonstrate correct implementation returns `Some`
- demonstrate out of bounds returns `None`
- demonstrate mutability

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

add test for #41229

Closes #41229

6 years agoRollup merge of #44457 - napen123:master, r=frewsxcv
Guillaume Gomez [Sun, 10 Sep 2017 12:03:30 +0000 (14:03 +0200)]
Rollup merge of #44457 - napen123:master, r=frewsxcv

Add doc examples for str::as_bytes_mut

Fixes #44427

6 years agoRollup merge of #44451 - Zoxc:gen-panic, r=eddyb
Guillaume Gomez [Sun, 10 Sep 2017 12:03:29 +0000 (14:03 +0200)]
Rollup merge of #44451 - Zoxc:gen-panic, r=eddyb

Fix bitrotted generator panic emission

r? @eddyb

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 #44312 - eddyb:static-by-any-other-name, r=alexcrichton
bors [Sun, 10 Sep 2017 10:09:47 +0000 (10:09 +0000)]
Auto merge of #44312 - eddyb:static-by-any-other-name, r=alexcrichton

Use rvalue promotion to 'static instead of static items.

Fixes #44240. Among other things, in crates that do a lot of formatting, this could reduce the number of items, although I haven't measured the performance benefits. If there's a codegen slowdown, that should IMO be solved by caching the output of miri, *not* by using `static`.

r? @alexcrichton

6 years agofix "correct" case in diagnostic error message
Niko Matsakis [Sun, 10 Sep 2017 10:08:29 +0000 (06:08 -0400)]
fix "correct" case in diagnostic error message

6 years agoUse rvalue promotion to 'static instead of static items.
Eduard-Mihai Burtescu [Mon, 4 Sep 2017 10:23:49 +0000 (13:23 +0300)]
Use rvalue promotion to 'static instead of static items.

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 agoRelaxed error pattern, and add test for SystemTime as well.
kennytm [Sat, 9 Sep 2017 17:48:43 +0000 (01:48 +0800)]
Relaxed error pattern, and add test for SystemTime as well.

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 agoFix incorrect markdown title
smt923 [Sun, 10 Sep 2017 03:33:24 +0000 (04:33 +0100)]
Fix incorrect markdown title

6 years agoAdded short examples for 'str::from_utf8_mut'
smt923 [Sun, 10 Sep 2017 03:10:19 +0000 (04:10 +0100)]
Added short examples for 'str::from_utf8_mut'

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 agodocumentation update to demonstrate mutability
toidiu [Sat, 9 Sep 2017 20:56:12 +0000 (16:56 -0400)]
documentation update to demonstrate mutability

6 years agoadd test for #41229
Evgeniy A. Dushistov [Sat, 9 Sep 2017 20:12:41 +0000 (23:12 +0300)]
add test for #41229

Closes #41229

6 years agoDon't promote references to statics that occur in non-static locations
Aaron Hill [Sat, 9 Sep 2017 20:01:45 +0000 (16:01 -0400)]
Don't promote references to statics that occur in non-static locations

6 years agoRotate Travis/AppVeyor S3 keys
Alex Crichton [Thu, 7 Sep 2017 05:47:56 +0000 (22:47 -0700)]
Rotate Travis/AppVeyor S3 keys

Haven't done this in awhile so seems like a good idea!

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 agoAdd doc examples for str::as_bytes_mut
Ethan Dagner [Sat, 9 Sep 2017 16:27:47 +0000 (10:27 -0600)]
Add doc examples for str::as_bytes_mut

Fixes #44427

6 years agoStabilize drop_types_in_const.
Eduard-Mihai Burtescu [Sat, 2 Sep 2017 07:35:01 +0000 (10:35 +0300)]
Stabilize drop_types_in_const.

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 agoFix bitrotted generator panic emission
John Kåre Alsaker [Sat, 9 Sep 2017 09:11:13 +0000 (11:11 +0200)]
Fix bitrotted generator panic emission

6 years agoAdd `impl From<Vec<Span>> for MultiSpan`.
Sergio Benitez [Sat, 9 Sep 2017 09:07:31 +0000 (02:07 -0700)]
Add `impl From<Vec<Span>> for MultiSpan`.

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 agoadding E0623 for LateBound regions
gaurikholkar [Fri, 25 Aug 2017 06:21:22 +0000 (11:51 +0530)]
adding E0623 for LateBound regions

6 years agoAdd feature gate to doctests.
J. Cliff Dyer [Fri, 8 Sep 2017 21:20:31 +0000 (17:20 -0400)]
Add feature gate to doctests.

6 years agoFix regression in promotion of rvalues referencing a static
Aaron Hill [Sat, 9 Sep 2017 00:22:50 +0000 (20:22 -0400)]
Fix regression in promotion of rvalues referencing a static

This commit makes librustc_passes::consts::CheckCrateVisitor properly
mark expressions as promotable if they reference a static, as it's
perfectly fine for one static to reference another. It fixes a
regression that prevented a temporary rvalue from referencing a static
if it was itself declared within a static.

Prior to commit https://github.com/rust-lang/rust/commit/b8c05fe90bc,
`region::ScopeTree` would only register a 'terminating scope' for function
bodies. Thus, while rvalues in a static that referenced a static would be marked
unpromotable, the lack of enclosing scope would cause
mem_categorization::MemCategorizationContext::cat_rvalue_node
to compute a 'temporary scope' of `ReStatic`. Since this had the same
effect as explicitly selecting a scope of `ReStatic`
due to the rvalue being marked by CheckCrateVisitor as promotable,
no issue occurred.

However, commit https://github.com/rust-lang/rust/commit/b8c05fe90bc
made ScopeTree unconditionally register a 'terminating scope'
Since mem_categorization would now compute a non-static 'temporary scope', the
aforementioned rvalues would be erroneously marked as living for too
short a time.

By fixing the behavior of CheckCrateVisitor, this commit avoids changing
mem_categorization's behavior, while ensuring that temporary values in
statics are still allowed to reference other statics.

Fixes issue #44373

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 agoAdd a test for `min_global_align`
Josh Stone [Fri, 8 Sep 2017 22:55:28 +0000 (15:55 -0700)]
Add a test for `min_global_align`

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 agoAdd `TargetOptions::min_global_align`, with s390x at 16-bit
Josh Stone [Fri, 8 Sep 2017 21:49:51 +0000 (14:49 -0700)]
Add `TargetOptions::min_global_align`, with s390x at 16-bit

The SystemZ `LALR` instruction provides PC-relative addressing for
globals, but only to *even* addresses, so other compilers make sure that
such globals are always 2-byte aligned.  In Clang, this is modeled with
`TargetInfo::MinGlobalAlign`, and `TargetOptions::min_global_align` now
serves the same purpose for rustc.

In Clang, the only targets that set this are SystemZ, Lanai, and NVPTX,
and the latter two don't have targets in rust master.

6 years agoUse NodeId/HirId instead of DefId for local variables.
Eduard-Mihai Burtescu [Sat, 29 Apr 2017 11:39:47 +0000 (14:39 +0300)]
Use NodeId/HirId instead of DefId for local variables.

6 years agosimplify
Douglas Campos [Fri, 8 Sep 2017 15:06:28 +0000 (11:06 -0400)]
simplify

6 years agoUpdate liblibc submodule to include latest uclibc changes
Tobias Schaffner [Fri, 8 Sep 2017 12:34:10 +0000 (14:34 +0200)]
Update liblibc submodule to include latest uclibc changes

6 years agoMove the stack size value for L4Re to the min_stack_size function
Sebastian Humenda [Thu, 7 Sep 2017 19:04:24 +0000 (21:04 +0200)]
Move the stack size value for L4Re to the min_stack_size function

6 years agoRe-enable networking module fo rL4Re
Sebastian Humenda [Wed, 6 Sep 2017 14:01:51 +0000 (16:01 +0200)]
Re-enable networking module fo rL4Re

As suggested in the discussion of PR #43972, std should provide a uniform API to
all platforms. Since there's no networking on L4Re, this now is a module in
`sys::net` providing types and functions/methods returning an error for each
action.

6 years agoAdd modifications needed for L4re in libstd
Tobias Schaffner [Fri, 18 Aug 2017 09:50:20 +0000 (11:50 +0200)]
Add modifications needed for L4re in libstd

This commit adds the needed modifications to compile the std crate
for the L4 Runtime environment (L4Re).

A target for the L4Re was introduced in commit:
c151220a84e40b65e45308cc0f3bbea4466d3acf

In many aspects implementations for linux also apply for the L4Re
microkernel.

Two uncommon characteristics had to be resolved:
* L4Re has no network funktionality
* L4Re has a maximum stacksize of 1Mb for threads

Co-authored-by: Sebastian Humenda <sebastian.humenda@tu-dresden.de>
6 years agoMatch c_char definitions and enable signal reset for L4Re
Sebastian Humenda [Thu, 17 Aug 2017 11:23:00 +0000 (13:23 +0200)]
Match c_char definitions and enable signal reset for L4Re

*   Match definition of c_char in os/raw.rs with the libc definition

    Due to historic reasons, os/raw.rs redefines types for c_char from
    libc, but these didn't match. Now they do :).

*   Enable signal reset on exec for L4Re

    L4Re has full signal emulation and hence it needs to reset the
    signal set of the child with sigemptyset. However, gid and uid
    should *not* be set.

6 years agoMove the man directory to a subdirectory
est31 [Fri, 8 Sep 2017 10:37:39 +0000 (12:37 +0200)]
Move the man directory to a subdirectory

There is no reason it should be in the top directory.

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 agoFix sanitizer tests on buggy kernels
Alex Crichton [Thu, 7 Sep 2017 20:36:23 +0000 (13:36 -0700)]
Fix sanitizer tests on buggy kernels

Travis recently pushed an update to the Linux environments, namely the kernels
that we're running on. This in turn caused some of the sanitizer tests we run to
fail. We also apparently weren't the first to hit these failures! Detailed in
google/sanitizers#837 these tests were failing due to a specific commit in the
kernel which has since been backed out, but for now work around the buggy kernel
that's deployed on Travis and eventually we should be able to remove these
flags.

6 years agoClose doc examples and trim whitespace.
J. Cliff Dyer [Thu, 7 Sep 2017 23:06:57 +0000 (19:06 -0400)]
Close doc examples and trim whitespace.

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 agoIP address convenience constructors
J. Cliff Dyer [Thu, 7 Sep 2017 18:08:58 +0000 (14:08 -0400)]
IP address convenience constructors

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 agoClarify the behavior of UDP sockets wrt. multiple addresses in `connect`
Tobias Bucher [Thu, 7 Sep 2017 09:26:23 +0000 (11:26 +0200)]
Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

6 years agoDisable the 80-year-difference test on 32-bit-time_t platforms.
kennytm [Thu, 7 Sep 2017 05:09:18 +0000 (13:09 +0800)]
Disable the 80-year-difference test on 32-bit-time_t platforms.

6 years agoFix incorrect test in `time::tests::system_time_math`.
kennytm [Sun, 3 Sep 2017 09:31:43 +0000 (17:31 +0800)]
Fix incorrect test in `time::tests::system_time_math`.

6 years agoProperly detect overflow in Instance +/- Duration.
kennytm [Thu, 31 Aug 2017 17:16:24 +0000 (01:16 +0800)]
Properly detect overflow in Instance +/- Duration.

Avoid unchecked cast from `u64` to `i64`. Use `try_into()` for checked
cast. (On Unix, cast to `time_t` instead of `i64`.)

6 years agoFix mispositioned error indicators
est31 [Thu, 7 Sep 2017 06:47:13 +0000 (08:47 +0200)]
Fix mispositioned error indicators

Fixes #38384

Most of the Rust community uses 4 spaces for indentation,
but there are also tab users of Rust (including myself!).

This patch fixes a bug in error printing which mispositions
error indicators when near code with tabs.

The code attempted to fix the issue by replacing spaces
with tabs, but it sadly wasn't enough, as sometimes
you may not print spaces but _ or ^ instead.

This patch employs the reverse strategy: it replaces each
tab with a space, so that the number of _ and ^ and spaces
in error indicators below the code snippet line up
perfectly.

In a study [1] preceeding this patch, we could see that
this strategy is also chosen by gcc version 6.3.0.

Its not perfect, as the output is not beautiful, but its
the easiest to implement. If anyone wants to improve on
this, be my guest! This patch is meant as improvement of
the status quo, not as perfect end status. It fixes the
actual issue of mispositioning error indicators.

[1]: https://github.com/rust-lang/rust/issues/38384#issuecomment-326813710

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 agobetter test documentation
Douglas Campos [Thu, 7 Sep 2017 03:10:08 +0000 (23:10 -0400)]
better test documentation

6 years agougly, but works!
Douglas Campos [Thu, 7 Sep 2017 03:03:41 +0000 (23:03 -0400)]
ugly, but works!

6 years agoadd broken test
Douglas Campos [Thu, 7 Sep 2017 02:06:50 +0000 (22:06 -0400)]
add broken test

6 years agoci: introduce haiku x86_64 builder
Jessica Hamilton [Wed, 6 Sep 2017 17:07:05 +0000 (12:07 -0500)]
ci: introduce haiku x86_64 builder

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