]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #40404 - cengizIO:master, r=nikomatsakis
Ariel Ben-Yehuda [Sat, 11 Mar 2017 19:57:48 +0000 (21:57 +0200)]
Rollup merge of #40404 - cengizIO:master, r=nikomatsakis

fix #40294 obligation cause.body_id is not always a NodeExpr

Hello!

This fixes #40294 and moves tests related to #38812 to a much more sensible directory.

Thanks to @nikomatsakis and @eddyb

7 years agoRollup merge of #40400 - TimNN:gdbr-updates, r=alexcrichton
Ariel Ben-Yehuda [Sat, 11 Mar 2017 19:57:47 +0000 (21:57 +0200)]
Rollup merge of #40400 - TimNN:gdbr-updates, r=alexcrichton

Update gdbr tests

gdb will now reliably detect the lanugage as rust even before any code is run.

7 years agoRollup merge of #40373 - TimNN:test-ub-packed, r=arielb1
Ariel Ben-Yehuda [Sat, 11 Mar 2017 19:57:46 +0000 (21:57 +0200)]
Rollup merge of #40373 - TimNN:test-ub-packed, r=arielb1

Fix UB in repr(packed) tests

r? @arielb1

cc #37609 and #27060

7 years agoRollup merge of #40372 - nagisa:never-drop, r=eddyb
Ariel Ben-Yehuda [Sat, 11 Mar 2017 19:57:45 +0000 (21:57 +0200)]
Rollup merge of #40372 - nagisa:never-drop, r=eddyb

Do not bother creating StorageLive for TyNever

Keeps MIR cleaner, `StorageLive(_: !)` makes no sense anyway.

r? @eddyb

7 years agoRollup merge of #40345 - Nashenas88:patch-1, r=estebank
Ariel Ben-Yehuda [Sat, 11 Mar 2017 19:57:44 +0000 (21:57 +0200)]
Rollup merge of #40345 - Nashenas88:patch-1, r=estebank

Fix missing backtick typo

Fixes rendering of the end of the `Configure and Make` section.

7 years agoRollup merge of #40344 - nrc:save-container, r=eddyb
Ariel Ben-Yehuda [Sat, 11 Mar 2017 19:57:43 +0000 (21:57 +0200)]
Rollup merge of #40344 - nrc:save-container, r=eddyb

save-analysis: cope with lack of method data after a type error

Fixes #39957

r? @eddyb

7 years agoRollup merge of #40319 - eddyb:it's-"unsize"-not-"unsound", r=nikomatsakis
Ariel Ben-Yehuda [Sat, 11 Mar 2017 19:57:42 +0000 (21:57 +0200)]
Rollup merge of #40319 - eddyb:it's-"unsize"-not-"unsound", r=nikomatsakis

Disallow subtyping between T and U in T: Unsize<U>.

Because `&mut T` can be coerced to `&mut U`, `T` and `U` must be unified invariantly. Fixes #40288.
E.g. coercing `&mut [&'a X; N]` to `&mut [&'b X]` must require `'a` be equal to `'b`, otherwise you can convert between `&'a X` and `&'b X` (in either direction), potentially unsoundly lengthening lifetimes.

Subtyping here was introduced with `Unsize` in #24619 (landed in 1.1, original PR is #23785).

7 years agoRollup merge of #40315 - oli-obk:lint_body, r=eddyb
Ariel Ben-Yehuda [Sat, 11 Mar 2017 19:57:41 +0000 (21:57 +0200)]
Rollup merge of #40315 - oli-obk:lint_body, r=eddyb

Allow lints to check Bodys directly

r? @eddyb

babysteps towards fixing https://github.com/Manishearth/rust-clippy/issues/1580 (disable certain lints in const environments, since they make no sense there (yet))

7 years agoRollup merge of #40299 - GuillaumeGomez:fmt-display-example, r=frewsxcv
Ariel Ben-Yehuda [Sat, 11 Mar 2017 19:57:40 +0000 (21:57 +0200)]
Rollup merge of #40299 - GuillaumeGomez:fmt-display-example, r=frewsxcv

Add missing example for Display::fmt

r? @frewsxcv

7 years agoRollup merge of #40146 - bjorn3:few-infer-changes, r=pnkfelix
Ariel Ben-Yehuda [Sat, 11 Mar 2017 19:57:39 +0000 (21:57 +0200)]
Rollup merge of #40146 - bjorn3:few-infer-changes, r=pnkfelix

Better docs of rusty parts of typeck

7 years agoAuto merge of #40308 - nikomatsakis:incr-comp-isolate-task, r=mw
bors [Sat, 11 Mar 2017 15:50:33 +0000 (15:50 +0000)]
Auto merge of #40308 - nikomatsakis:incr-comp-isolate-task, r=mw

first pass at isolating dep-graph tasks

This intentionally leaves `DepGraph::in_task()`, the more common form,
alone. Eventually all uses of `DepGraph::in_task()` should be ported
to `with_task()`, but I wanted to start with a smaller subset.

I also used `AssertDepGraphSafe` on the closures that are found in
trans. This is because the types there are non-trivial and I wanted to
lay down the mechanism and come back to the more subtle cases.

The current approach taken in this PR has a downside: it is necessary
to manually "reify" fn types into fn pointers when starting a task,
like so:

    dep_graph.with_task(..., task_fn as fn(_))

this is because `with_task` takes some type `T` that implements
`DepGraphTask` rather than taking a `fn()` type directly. *This* is so
that we can accept closure and also so that we can accept fns with
multiple arities. I am not sure this is the right approach.

Originally I wanted to use closures bound by an auto trait, but that
approach has some limitations:

- the trait cannot have a `read()` method; since the current method
  is unused, that may not be a problem.
- more importantly, we would want the auto trait to be "undefined" for all types
  *by default* -- that is, this use case doesn't really fit the typical
  auto trait scenario. For example, imagine that there is a `u32` loaded
  out of a `hir::Node` -- we don't really want to be passing that
  `u32` into the task!

7 years agoAuto merge of #40199 - alexcrichton:doc-proc-macro, r=brson
bors [Sat, 11 Mar 2017 11:42:09 +0000 (11:42 +0000)]
Auto merge of #40199 - alexcrichton:doc-proc-macro, r=brson

rustbuild: Build documentation for `proc_macro`

This commit fixes #38749 by building documentation for the `proc_macro` crate by
default for configured hosts. Unfortunately did not turn out to be a trivial
fix. Currently rustbuild generates documentation into multiple locations: one
for std, one for test, and one for rustc. The initial fix for this issue simply
actually executed `cargo doc -p proc_macro` which was otherwise completely
elided before.

Unfortunately rustbuild was the left to merge two documentation trees together.
One for the standard library and one for the rustc tree (which only had docs for
the `proc_macro` crate). Rustdoc itself knows how to merge documentation files
(specifically around search indexes, etc) but rustbuild was unaware of this, so
an initial fix ended up destroying the sidebar and the search bar from the
libstd docs.

To solve this issue the method of documentation has been tweaked slightly in
rustbuild. The build system will not use symlinks (or directory junctions on
Windows) to generate all documentation into the same location initially. This'll
rely on rustdoc's logic to weave together all the output and ensure that it ends
up all consistent.

Closes #38749

7 years agoAuto merge of #39648 - Aatch:mir-inlining-2, r=eddyb
bors [Sat, 11 Mar 2017 08:25:44 +0000 (08:25 +0000)]
Auto merge of #39648 - Aatch:mir-inlining-2, r=eddyb

[MIR] Implement Inlining

Fairly basic implementation of inlining for MIR. Uses conservative
heuristics for inlining.

Doesn't handle a number of cases, but can be extended later. This is basically the same as the previous inlining PR, but without the span-related changes (as the bugs it was dealing with have since been fixed).

/cc @rust-lang/compiler

7 years agoAuto merge of #40432 - alexcrichton:rollup, r=alexcrichton
bors [Sat, 11 Mar 2017 05:41:41 +0000 (05:41 +0000)]
Auto merge of #40432 - alexcrichton:rollup, r=alexcrichton

Rollup of 38 pull requests

- Successful merges: #39202, #39820, #39918, #39921, #40092, #40146, #40199, #40225, #40239, #40257, #40259, #40261, #40277, #40278, #40287, #40297, #40311, #40315, #40319, #40324, #40336, #40340, #40344, #40345, #40367, #40369, #40372, #40373, #40379, #40385, #40386, #40389, #40400, #40404, #40410, #40422, #40423, #40424
- Failed merges: #40220, #40329, #40426

7 years agoTest fixes and rebase conflicts
Alex Crichton [Sat, 11 Mar 2017 00:16:27 +0000 (16:16 -0800)]
Test fixes and rebase conflicts

7 years agoRollup merge of #40424 - alexcrichton:faster-travis-osx, r=brson
Alex Crichton [Fri, 10 Mar 2017 22:51:50 +0000 (16:51 -0600)]
Rollup merge of #40424 - alexcrichton:faster-travis-osx, r=brson

travis: Remove compiling OpenSSL through homebrew

I don't believe that we need this any more now that `cargo-vendor` isn't
installed to create a source tarball (that only happens on Linux)

7 years agoRollup merge of #40423 - DirkyJerky:patch-2, r=BurntSushi
Alex Crichton [Fri, 10 Mar 2017 22:51:49 +0000 (16:51 -0600)]
Rollup merge of #40423 - DirkyJerky:patch-2, r=BurntSushi

Clarify docs in `VecDeque::resize`

7 years agoRollup merge of #40410 - clarcharr:os_string_shrink_to_fit, r=alexcrichton
Alex Crichton [Fri, 10 Mar 2017 22:51:46 +0000 (16:51 -0600)]
Rollup merge of #40410 - clarcharr:os_string_shrink_to_fit, r=alexcrichton

OsString::shrink_to_fit.

Considering how the other capacity-related methods are there, I found it odd that this one wasn't included.

Will create a tracking issue once I get an OK on this.

7 years agoRollup merge of #40389 - F001:placementVecDeque, r=nagisa
Alex Crichton [Fri, 10 Mar 2017 22:51:43 +0000 (16:51 -0600)]
Rollup merge of #40389 - F001:placementVecDeque, r=nagisa

Implement placement-in protocol for `VecDeque`

CC #30172

r? @nagisa

7 years agoRollup merge of #40386 - tbu-:pr_display_frombyteswithnulerror, r=alexcrichton
Alex Crichton [Fri, 10 Mar 2017 22:51:42 +0000 (16:51 -0600)]
Rollup merge of #40386 - tbu-:pr_display_frombyteswithnulerror, r=alexcrichton

Distinguish the ways `CStr::from_bytes_with_nul` can fail

7 years agoRollup merge of #40379 - clarcharr:box_docs, r=brson
Alex Crichton [Fri, 10 Mar 2017 22:51:40 +0000 (16:51 -0600)]
Rollup merge of #40379 - clarcharr:box_docs, r=brson

Box docs: no allocation is done for ZSTs.

Updated to add a small bit saying that ZSTs don't actually allocate on `Box::new`.

7 years agoAuto merge of #40422 - alexcrichton:retry-linker-segfault, r=arielb1
bors [Sat, 11 Mar 2017 00:54:09 +0000 (00:54 +0000)]
Auto merge of #40422 - alexcrichton:retry-linker-segfault, r=arielb1

rustc: Support auto-retry linking on a segfault

This is a last-ditch attempt to help our pain with dealing with #38878 on the
bots. A new environment variable is added to the compiler,
`RUSTC_RETRY_LINKER_ON_SEGFAULT`, which will instruct the compiler to
automatically retry the final linker invocation if it looks like the linker
segfaulted (up to 2 extra times).

Unfortunately there have been no successful attempts to debug #38878. The only
information seems to be that the linker (e.g. `ld` on OSX) is segfaulting
somewhere in some thread pool implementation. This appears to be spurious as
failed PRs will later merge.

The hope is that this helps the queue keep moving without clogging and delaying
PRs due to #38878.

7 years agoRollup merge of #40336 - alexcrichton:fast-dep-info, r=nrc
Alex Crichton [Fri, 10 Mar 2017 22:51:32 +0000 (16:51 -0600)]
Rollup merge of #40336 - alexcrichton:fast-dep-info, r=nrc

rustc: Exit quickly on only `--emit dep-info`

This commit alters the compiler to exit quickly if the only output being emitted
is `dep-info`, which doesn't need a lot of other information to generate.

Closes #40328

7 years agoRollup merge of #40324 - alexcrichton:sccache-errors, r=aturon
Alex Crichton [Fri, 10 Mar 2017 22:51:31 +0000 (16:51 -0600)]
Rollup merge of #40324 - alexcrichton:sccache-errors, r=aturon

travis: Attempt to debug sccache failures

I can't find anything that'd cause unexpected EOF in the source, so let's try
taking a look at the error logs on failures.

7 years agoRollup merge of #40311 - nrc:save-proc-macro-attr, r=jseyfried
Alex Crichton [Fri, 10 Mar 2017 22:51:28 +0000 (16:51 -0600)]
Rollup merge of #40311 - nrc:save-proc-macro-attr, r=jseyfried

Expect macro defs in save-analysis and add expn info to spans for att…

…r proc macros

r? @jseyfried

7 years agoRollup merge of #40297 - alexcrichton:fix-submodules, r=brson
Alex Crichton [Fri, 10 Mar 2017 22:51:27 +0000 (16:51 -0600)]
Rollup merge of #40297 - alexcrichton:fix-submodules, r=brson

Don't put Cargo into the rustc workspace

This causes problems when first cloning and bootstrapping the repository
unfortunately, so let's ensure that Cargo sticks around in its own workspace.
Because Cargo is a submodule it's not available by default on the inital clone
of the rust-lang/rust repository. Normally it's the responsibility of the
rustbuild to take care of this, but unfortunately to build rustbuild itself we
need to resolve the workspace conflicts.

To deal with this we'll just have to ensure that all submodules are in their own
workspace, which sort of makes sense anyway as updates to dependencies as
bugfixes to Cargo should go to rust-lang/cargo instead of rust-lang/rust. In any
case this commit removes Cargo from the global workspace which should resolve
the issues that we've been seeing.

To actually perform this the `cargo` submodule has been moved to a new `vendor`
directory to ensure it's outside the scope of `src/Cargo.toml` as a workspace.

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

7 years agoRollup merge of #40287 - estebank:label-overlap, r=nrc
Alex Crichton [Fri, 10 Mar 2017 22:51:26 +0000 (16:51 -0600)]
Rollup merge of #40287 - estebank:label-overlap, r=nrc

Fix incorrect span label formatting

Fix #40157.

7 years agoRollup merge of #40278 - GuillaumeGomez:css-cleanup, r=frewsxcv
Alex Crichton [Fri, 10 Mar 2017 22:51:25 +0000 (16:51 -0600)]
Rollup merge of #40278 - GuillaumeGomez:css-cleanup, r=frewsxcv

Clean up rustdoc css

r? @rust-lang/docs

7 years agoRollup merge of #40277 - rkruppe:llvm-parallel-link-jobs, r=alexcrichton
Alex Crichton [Fri, 10 Mar 2017 22:51:24 +0000 (16:51 -0600)]
Rollup merge of #40277 - rkruppe:llvm-parallel-link-jobs, r=alexcrichton

rustbuild: expose LLVM_PARALLEL_LINK_JOBS

This allows limiting the number of linker jobs to avoid swapping when linking LLVM with debug info.

7 years agoRollup merge of #40261 - infinity0:patch-1, r=alexcrichton
Alex Crichton [Fri, 10 Mar 2017 22:51:23 +0000 (16:51 -0600)]
Rollup merge of #40261 - infinity0:patch-1, r=alexcrichton

Support armhf abi on 64-bit ARM cpus

They report their `uname -m` as armv8l rather than aarch64.

Patch originally by Matthias Klose <doko@debian.org>

7 years agoRollup merge of #40259 - TimNN:fix-emscripten-tests, r=alexcrichton
Alex Crichton [Fri, 10 Mar 2017 22:51:22 +0000 (16:51 -0600)]
Rollup merge of #40259 - TimNN:fix-emscripten-tests, r=alexcrichton

Fix emscripten test detection

Without this change `rustbuild` will attempt to run `.js.map` files (if they exist) resulting in lots of sadness.

r? @alexcrichton

7 years agoRollup merge of #40239 - nagisa:death-to-plugins, r=nikomatsakis
Alex Crichton [Fri, 10 Mar 2017 22:51:20 +0000 (16:51 -0600)]
Rollup merge of #40239 - nagisa:death-to-plugins, r=nikomatsakis

Remove ability for plugins to register a MIR pass

In recent months there have been a few different people investigating how to make a plugin that
registers a MIR-pass – one that isn’t intended to be eventually merged into rustc proper.

The interface to register MIR passes was added primarily for miri (& later was
found to make prototyping of rustc-proper MIR passes a tiny bit faster). Since miri does not use
this interface anymore it seems like a good time to remove this "feature".

For prototyping purposes a similar interface can be added by developers themselves in their custom
rustc build.

cc @nikomatsakis

7 years agoRollup merge of #40225 - shepmaster:restore-build-date-file, r=alexcrichton
Alex Crichton [Fri, 10 Mar 2017 22:51:19 +0000 (16:51 -0600)]
Rollup merge of #40225 - shepmaster:restore-build-date-file, r=alexcrichton

Restore creating the channel-rust-$channel-date.txt files

I have **not** run this (because I don't know how to 😇), but it *does* compile.

r? @alexcrichton

7 years agoRollup merge of #40092 - sinkuu:fix_suggestion_index, r=pnkfelix
Alex Crichton [Fri, 10 Mar 2017 22:51:16 +0000 (16:51 -0600)]
Rollup merge of #40092 - sinkuu:fix_suggestion_index, r=pnkfelix

Fix suggestion span error with a line containing multibyte characters

This PR fixes broken suggestions caused by multibyte characters.

e.g. for this code, rustc provides a broken suggestion ([playground](https://is.gd/DWGLu7)):

```rust
fn main() {
    let tup = (1,);
    println!("☃{}", tup[0]);
}
```

```
error: cannot index a value of type `({integer},)`
 --> <anon>:3:21
  |
3 |     println!("☃{}", tup[0]);
  |                     ^^^^^^
  |
help: to access tuple elements, use tuple indexing syntax as shown
  |     println!("☃{}"tup.00]);

error: aborting due to previous error
```

`CodeSuggestion::splice_lines` is misusing `Loc.col` (`CharPos`) as a byte offset when slicing source.

7 years agoRollup merge of #39918 - petrhosek:fuchsia-ci, r=alexcrichton
Alex Crichton [Fri, 10 Mar 2017 22:51:14 +0000 (16:51 -0600)]
Rollup merge of #39918 - petrhosek:fuchsia-ci, r=alexcrichton

travis: Fuchsia builder

This change introduces a Dockerfile and script which builds a complete
Fuchsia toolchain which can be used to build Rust distribution for
Fuchsia. We only support cross-compiling at the moment, hence only
setting the target.

7 years agoRollup merge of #39820 - jonasbb:export-attributes, r=nrc
Alex Crichton [Fri, 10 Mar 2017 22:51:13 +0000 (16:51 -0600)]
Rollup merge of #39820 - jonasbb:export-attributes, r=nrc

Export attributes in save-analysis data

Since this is my first pull-request to rust, I would like to get some feedback about obvious errors in this implementation.

I would like to change the save-analysis data to include arbitrary attribute data.
A use-case I have in mind for this is identifying functions with `#[test]` annotations such that tools like rls can offer a test-runner feature. I described my idea here [rls#173](https://github.com/rust-lang-nursery/rls/issues/173).

My changes contain:

1. track a vector of attributes in the various `*Data` types in `data.rs` and `external_data.rs`
2. implement lowering for `Attribute` and `MetaItem`
3. adjust `JsonDumper` to print the attributes

In the lowering of `Attribute` I remove the distinction between `MetaItem` and `NestedMetaItem`. I did this because this distinction is somewhat confusing. For example, `NestedMetaItemKind::Literal` has two identical spans, because both `NestedMetaItem` and `Lit` are defined as `Spanned<_>`.
My model is strictly more general, as it allows an `LitKind` instead of a `Symbol` for `MetaItem` and `Symbol`s are converted into a cooked string. As a consumer of the save-analysis data this shouldn't affect you much.

Example json output of `#[test]` annotation:
```
"attributes": [
  {
    "value": {
      "name": {
        "variant": "Str",
        "fields": [
          "test",
          "Cooked"
        ]
      },
      "kind": "Literal",
      "span": {
        "file_name": "test.rs",
        "byte_start": 2,
        "byte_end": 6,
        "line_start": 1,
        "line_end": 1,
        "column_start": 3,
        "column_end": 7
      }
    },
    "span": {
      "file_name": "test.rs",
      "byte_start": 0,
      "byte_end": 7,
      "line_start": 1,
      "line_end": 1,
      "column_start": 1,
      "column_end": 8
    }
  }
]
```

7 years agoRollup merge of #39202 - estebank:nested-unsafe, r=jonathandturner
Alex Crichton [Fri, 10 Mar 2017 22:51:12 +0000 (16:51 -0600)]
Rollup merge of #39202 - estebank:nested-unsafe, r=jonathandturner

Point to enclosing block/fn on nested unsafe

When declaring nested unsafe blocks (`unsafe {unsafe {}}`) that trigger
the "unnecessary `unsafe` block" error, point out the enclosing `unsafe
block` or `unsafe fn` that makes it unnecessary.

<img width="621" alt="" src="https://cloud.githubusercontent.com/assets/1606434/22139922/26ad468a-de9e-11e6-8884-2945be882ea8.png">

Fixes #39144.

7 years agoDon't put Cargo into the rustc workspace
Alex Crichton [Mon, 6 Mar 2017 14:55:24 +0000 (06:55 -0800)]
Don't put Cargo into the rustc workspace

This causes problems when first cloning and bootstrapping the repository
unfortunately, so let's ensure that Cargo sticks around in its own workspace.
Because Cargo is a submodule it's not available by default on the inital clone
of the rust-lang/rust repository. Normally it's the responsibility of the
rustbuild to take care of this, but unfortunately to build rustbuild itself we
need to resolve the workspace conflicts.

To deal with this we'll just have to ensure that all submodules are in their own
workspace, which sort of makes sense anyway as updates to dependencies as
bugfixes to Cargo should go to rust-lang/cargo instead of rust-lang/rust. In any
case this commit removes Cargo from the global workspace which should resolve
the issues that we've been seeing.

To actually perform this the `cargo` submodule has been moved to the top
directory to ensure it's outside the scope of `src/Cargo.toml` as a workspace.

7 years agorustbuild: Build documentation for `proc_macro`
Alex Crichton [Wed, 1 Mar 2017 23:34:54 +0000 (15:34 -0800)]
rustbuild: Build documentation for `proc_macro`

This commit fixes #38749 by building documentation for the `proc_macro` crate by
default for configured hosts. Unfortunately did not turn out to be a trivial
fix. Currently rustbuild generates documentation into multiple locations: one
for std, one for test, and one for rustc. The initial fix for this issue simply
actually executed `cargo doc -p proc_macro` which was otherwise completely
elided before.

Unfortunately rustbuild was the left to merge two documentation trees together.
One for the standard library and one for the rustc tree (which only had docs for
the `proc_macro` crate). Rustdoc itself knows how to merge documentation files
(specifically around search indexes, etc) but rustbuild was unaware of this, so
an initial fix ended up destroying the sidebar and the search bar from the
libstd docs.

To solve this issue the method of documentation has been tweaked slightly in
rustbuild. The build system will not use symlinks (or directory junctions on
Windows) to generate all documentation into the same location initially. This'll
rely on rustdoc's logic to weave together all the output and ensure that it ends
up all consistent.

Closes #38749

7 years agotravis: Remove compiling OpenSSL through homebrew
Alex Crichton [Fri, 10 Mar 2017 18:25:16 +0000 (10:25 -0800)]
travis: Remove compiling OpenSSL through homebrew

I don't believe that we need this any more now that `cargo-vendor` isn't
installed to create a source tarball (that only happens on Linux)

7 years agoClarify docs in `VecDeque::resize`
Geoff Yoerger [Fri, 10 Mar 2017 18:11:13 +0000 (12:11 -0600)]
Clarify docs in `VecDeque::resize`

7 years agoOsString::shrink_to_fit.
Clar Charr [Fri, 10 Mar 2017 05:23:54 +0000 (00:23 -0500)]
OsString::shrink_to_fit.

7 years agorustc: Support auto-retry linking on a segfault
Alex Crichton [Fri, 10 Mar 2017 17:04:27 +0000 (09:04 -0800)]
rustc: Support auto-retry linking on a segfault

This is a last-ditch attempt to help our pain with dealing with #38878 on the
bots. A new environment variable is added to the compiler,
`RUSTC_RETRY_LINKER_ON_SEGFAULT`, which will instruct the compiler to
automatically retry the final linker invocation if it looks like the linker
segfaulted (up to 2 extra times).

Unfortunately there have been no successful attempts to debug #38878. The only
information seems to be that the linker (e.g. `ld` on OSX) is segfaulting
somewhere in some thread pool implementation. This appears to be spurious as
failed PRs will later merge.

The hope is that this helps the queue keep moving without clogging and delaying
PRs due to #38878.

7 years agotravis: Fuchsia builder
Petr Hosek [Fri, 17 Feb 2017 04:54:24 +0000 (20:54 -0800)]
travis: Fuchsia builder

This change introduces a Dockerfile and script which builds a complete
Fuchsia toolchain which can be used to build Rust distribution for
Fuchsia. We only support cross-compiling at the moment, hence only
setting the target.

7 years agoAllow lints to check Bodys directly
Oliver Schneider [Tue, 7 Mar 2017 11:51:09 +0000 (12:51 +0100)]
Allow lints to check Bodys directly

7 years agosave-analysis: cope with lack of method data after a type error
Nick Cameron [Wed, 8 Mar 2017 02:06:53 +0000 (15:06 +1300)]
save-analysis: cope with lack of method data after a type error

Fixes #39957

7 years agorustc: Exit quickly on only `--emit dep-info`
Alex Crichton [Tue, 7 Mar 2017 23:15:55 +0000 (15:15 -0800)]
rustc: Exit quickly on only `--emit dep-info`

This commit alters the compiler to exit quickly if the only output being emitted
is `dep-info`, which doesn't need a lot of other information to generate.

Closes #40328

7 years agoExpect macro defs in save-analysis and add expn info to spans for attr proc macros
Nick Cameron [Tue, 7 Mar 2017 04:37:45 +0000 (17:37 +1300)]
Expect macro defs in save-analysis and add expn info to spans for attr proc macros

7 years agoadd comments and remove unused code paths
Niko Matsakis [Wed, 8 Mar 2017 14:14:27 +0000 (09:14 -0500)]
add comments and remove unused code paths

7 years agoisolate dep-graph tasks
Niko Matsakis [Mon, 6 Mar 2017 20:35:34 +0000 (15:35 -0500)]
isolate dep-graph tasks

A task function is now given as a `fn` pointer to ensure that it carries
no state. Each fn can take two arguments, because that worked out to be
convenient -- these two arguments must be of some type that is
`DepGraphSafe`, a new trait that is intended to prevent "leaking"
information into the task that was derived from tracked state.

This intentionally leaves `DepGraph::in_task()`, the more common form,
alone. Eventually all uses of `DepGraph::in_task()` should be ported
to `with_task()`, but I wanted to start with a smaller subset.

Originally I wanted to use closures bound by an auto trait, but that
approach has some limitations:

- the trait cannot have a `read()` method; since the current method
  is unused, that may not be a problem.
- more importantly, we would want the auto trait to be "undefined" for all types
  *by default* -- that is, this use case doesn't really fit the typical
  auto trait scenario. For example, imagine that there is a `u32` loaded
  out of a `hir::Node` -- we don't really want to be passing that
  `u32` into the task!

7 years agoFix incorrect span label formatting
Esteban Küber [Mon, 6 Mar 2017 02:51:46 +0000 (23:51 -0300)]
Fix incorrect span label formatting

7 years agoSupport armhf abi on 64-bit ARM cpus
Ximin Luo [Mon, 6 Mar 2017 20:42:55 +0000 (21:42 +0100)]
Support armhf abi on 64-bit ARM cpus

They report their `uname -m` as armv8l rather than aarch64.

Patch originally by Matthias Klose <doko@debian.org>

7 years agoRemove ability for plugins to register a MIR pass
Simonas Kazlauskas [Fri, 3 Mar 2017 17:11:34 +0000 (19:11 +0200)]
Remove ability for plugins to register a MIR pass

In recent months there have been a few different people investigating how to make a plugin that
registers a MIR-pass – one that isn’t intended to be eventually merged into rustc proper.

The interface to register MIR passes was added primarily for miri (& later was
found to make prototyping of rustc-proper MIR passes a tiny bit faster). Since miri does not use
this interface anymore it seems like a good time to remove this "feature".

For prototyping purposes a similar interface can be added by developers themselves in their custom
rustc build.

7 years agoMove remove_docs_from_attrs into lowering step
Jonas Bushart [Thu, 2 Mar 2017 21:38:57 +0000 (22:38 +0100)]
Move remove_docs_from_attrs into lowering step

7 years agoStore attributes as strings
Jonas Bushart [Thu, 23 Feb 2017 22:24:12 +0000 (23:24 +0100)]
Store attributes as strings

Remove the AST structure

7 years agoExport attributes in save-analysis data
Jonas Bushart [Tue, 14 Feb 2017 10:05:53 +0000 (11:05 +0100)]
Export attributes in save-analysis data

Some annotations like the "test" annotations might be of interest for
other projects, especially rls. Export all attributes in a new
attributes item.

7 years agoPoint to enclosing block/fn on nested unsafe
Esteban Küber [Fri, 20 Jan 2017 07:17:48 +0000 (23:17 -0800)]
Point to enclosing block/fn on nested unsafe

When declaring nested unsafe blocks (`unsafe {unsafe {}}`) that trigger
the "unnecessary `unsafe` block" error, point out the enclosing `unsafe
block` or `unsafe fn` that makes it unnecessary.

7 years agotravis: Attempt to debug sccache failures
Alex Crichton [Tue, 7 Mar 2017 17:08:03 +0000 (09:08 -0800)]
travis: Attempt to debug sccache failures

I can't find anything that'd cause unexpected EOF in the source, so let's try
taking a look at the error logs on failures.

7 years agoAdd missing example for Display::fmt
Guillaume Gomez [Mon, 6 Mar 2017 17:02:09 +0000 (18:02 +0100)]
Add missing example for Display::fmt

7 years agoAuto merge of #39518 - alexcrichton:update-cargo, r=arielb1
bors [Fri, 10 Mar 2017 13:22:12 +0000 (13:22 +0000)]
Auto merge of #39518 - alexcrichton:update-cargo, r=arielb1

rustbuild: Use copies instead of hard links

The original motivation for hard links was to speed up the various stages of
rustbuild, but in the end this is causing problems on Windows (#39504).

This commit tweaks the build system to use copies instead of hard links
unconditionally to ensure that the files accessed by Windows are always
disjoint.

Locally this added .3s to a noop build, so it shouldn't be too much of a
regression hopefully!

Closes #39504

7 years agomove related tests to type-check ui test directory
Cengiz Can [Fri, 10 Mar 2017 08:43:34 +0000 (11:43 +0300)]
move related tests to type-check ui test directory

7 years agoAuto merge of #39835 - brson:relnotes, r=brson
bors [Fri, 10 Mar 2017 07:49:06 +0000 (07:49 +0000)]
Auto merge of #39835 - brson:relnotes, r=brson

Release notes for 1.16

[Rendered](https://github.com/brson/rust/blob/relnotes/RELEASES.md)

7 years agoOnly run inlining if mir opts are enabled
James Miller [Wed, 8 Feb 2017 17:50:08 +0000 (06:50 +1300)]
Only run inlining if mir opts are enabled

7 years agoAdd dep-graph tasks where needed
James Miller [Wed, 8 Feb 2017 17:31:47 +0000 (06:31 +1300)]
Add dep-graph tasks where needed

7 years agoInitial implementation of inlining for MIR
James Miller [Wed, 8 Feb 2017 09:24:49 +0000 (22:24 +1300)]
Initial implementation of inlining for MIR

Fairly basic implementation of inlining for MIR. Uses conservative
heuristics for inlining.

7 years agoFix recursion depth counting in `layout`
James Miller [Wed, 8 Feb 2017 09:23:09 +0000 (22:23 +1300)]
Fix recursion depth counting in `layout`

7 years agoAdd extra methods to IndexVec and implement TypeFoldable for it
James Miller [Wed, 8 Feb 2017 09:19:22 +0000 (22:19 +1300)]
Add extra methods to IndexVec and implement TypeFoldable for it

Adds `get`/`get_mut` accessors and `drain`/`drain_enumerated` iterators
to IndexVec.

Implements TypeFoldable for IndexVec.

7 years agofix #40294 obligation cause.body_id is not always a NodeExpr
Cengiz Can [Thu, 9 Mar 2017 23:51:47 +0000 (02:51 +0300)]
fix #40294 obligation cause.body_id is not always a NodeExpr

7 years agoRelease notes for 1.16
Brian Anderson [Wed, 15 Feb 2017 02:52:28 +0000 (18:52 -0800)]
Release notes for 1.16

7 years agoupdate gdbr tests
Tim Neumann [Thu, 9 Mar 2017 21:11:23 +0000 (22:11 +0100)]
update gdbr tests

gdb will now reliably detect the lanugage as rust even before any
code is run.

7 years agoAuto merge of #40382 - alexcrichton:split-tested-targets, r=brson
bors [Thu, 9 Mar 2017 20:46:14 +0000 (20:46 +0000)]
Auto merge of #40382 - alexcrichton:split-tested-targets, r=brson

travis: Split the linux-tested-targets builder

Travis only gives us 30GB disk space and we don't currently have an option to
increase that. Each musl target generates "hello world" binaries of about 3.5MB
in size, and we're testing two targets in the same image. We have around 3k
run-pass tests and 2 musl targets which works out to around 20GB. That's
dangerously close to the limit and is causing PRs to bounce.

This PR splits up the builder in two, one for x86_64 musl and the other for
i686. Hopefully that'll keep us under the disk limit.

Closes #40359

7 years agotravis: Split the linux-tested-targets builder
Alex Crichton [Thu, 9 Mar 2017 03:46:44 +0000 (19:46 -0800)]
travis: Split the linux-tested-targets builder

Travis only gives us 30GB disk space and we don't currently have an option to
increase that. Each musl target generates "hello world" binaries of about 3.5MB
in size, and we're testing two targets in the same image. We have around 3k
run-pass tests and 2 musl targets which works out to around 20GB. That's
dangerously close to the limit and is causing PRs to bounce.

This PR splits up the builder in two, one for x86_64 musl and the other for
i686. Hopefully that'll keep us under the disk limit.

Closes #40359

7 years agoUse subtyping on the target of unsizing coercions.
Eduard-Mihai Burtescu [Thu, 9 Mar 2017 03:54:52 +0000 (05:54 +0200)]
Use subtyping on the target of unsizing coercions.

7 years agoClean up rustdoc css
Guillaume Gomez [Thu, 9 Mar 2017 18:02:59 +0000 (19:02 +0100)]
Clean up rustdoc css

7 years agoDo not bother creating StorageLive for TyNever
Simonas Kazlauskas [Wed, 8 Mar 2017 20:17:42 +0000 (22:17 +0200)]
Do not bother creating StorageLive for TyNever

Keeps MIR cleaner, `StorageLive(_: !)` makes no sense anyway.

7 years agorustc: Prefer loading crates in the sysroot
Alex Crichton [Mon, 6 Mar 2017 22:44:38 +0000 (14:44 -0800)]
rustc: Prefer loading crates in the sysroot

This commit is a random stab in the dark to fix the spurious failures on #39518.
The leading theory of the spurious failures on Windows is that the compiler is
loading a path in the `deps` folder, passing it to `link.exe`, and then this is
racing with Cargo itself updating those paths.

This race, however, has a few unique properties:

* It's isolated to just libstd. Most crates are never passed to the linker and
  simultaneously being worked on by Cargo. Cargo's typical execution of the
  dependency graph never hits this problem.
* The crates are already all located in the sysroot in addition to the `deps`
  folder. This means that the compiler actually has two candidates of crates to
  load, and it's just arbitrarily rejecting one.

Together this means that we shouldn't need to fix this problem "in the large"
and we can instead just fix it in this isolated situation (hopefully). To solve
this the compiler's been updated to prefer crates from the sysroot to leave
Cargo's structure to itself.

We'll see if this actually allows the PR to land...

7 years agorustbuild: Use copies instead of hard links
Alex Crichton [Sat, 4 Feb 2017 01:12:58 +0000 (17:12 -0800)]
rustbuild: Use copies instead of hard links

The original motivation for hard links was to speed up the various stages of
rustbuild, but in the end this is causing problems on Windows (#39504).

This commit tweaks the build system to use copies instead of hard links
unconditionally to ensure that the files accessed by Windows are always
disjoint.

Locally this added .3s to a noop build, so it shouldn't be too much of a
regression hopefully!

7 years agoImplement placement-in protocol for and `VecDeque`
Charlie Fan [Thu, 9 Mar 2017 07:50:48 +0000 (07:50 +0000)]
Implement placement-in protocol for and `VecDeque`

7 years agorustbuild: expose LLVM_PARALLEL_LINK_JOBS
Robin Kruppe [Sun, 5 Mar 2017 15:11:11 +0000 (16:11 +0100)]
rustbuild: expose LLVM_PARALLEL_LINK_JOBS

This allows limiting the number of linker jobs to avoid swapping when
linking LLVM with debug info.

7 years agoRestore creating the channel-rust-$channel-date.txt files
Jake Goulding [Fri, 3 Mar 2017 04:39:15 +0000 (23:39 -0500)]
Restore creating the channel-rust-$channel-date.txt files

7 years agoFix botched member variable rename
Jake Goulding [Sat, 4 Mar 2017 15:07:55 +0000 (10:07 -0500)]
Fix botched member variable rename

7 years agoDistinguish the ways `CStr::from_bytes_with_nul` can fail
Tobias Bucher [Thu, 9 Mar 2017 12:31:26 +0000 (13:31 +0100)]
Distinguish the ways `CStr::from_bytes_with_nul` can fail

7 years agofix emscripten test detection
Tim Neumann [Sat, 4 Mar 2017 13:59:49 +0000 (14:59 +0100)]
fix emscripten test detection

7 years agoAuto merge of #40368 - arielb1:rollup, r=arielb1
bors [Thu, 9 Mar 2017 08:26:17 +0000 (08:26 +0000)]
Auto merge of #40368 - arielb1:rollup, r=arielb1

Rollup of 20 pull requests

- Successful merges: #40154, #40222, #40226, #40237, #40254, #40258, #40265, #40268, #40279, #40283, #40292, #40293, #40296, #40316, #40321, #40325, #40326, #40327, #40333, #40335
- Failed merges:

7 years agoAuto merge of #40337 - alexcrichton:racy-dirs, r=brson
bors [Thu, 9 Mar 2017 06:06:34 +0000 (06:06 +0000)]
Auto merge of #40337 - alexcrichton:racy-dirs, r=brson

rustbuild: Assert directory creation succeeds

I've been seeing failures on the bots when building jemalloc and my assumption
is that it's because cwd isn't created. That may be possible if this
`create_dir_all` call change in this commit fails, in which case we ignore the
error.

This commit updates the location to call `create_dir_racy` which handles
concurrent invocations, as multiple build scripts may be trying to create the
`native` dir.

7 years agoOverhaul coercion to use the lazy InferOk obligations passing.
Eduard-Mihai Burtescu [Wed, 8 Mar 2017 12:36:49 +0000 (14:36 +0200)]
Overhaul coercion to use the lazy InferOk obligations passing.

7 years agoBox docs: no allocation is done for ZSTs.
Clar Charr [Thu, 9 Mar 2017 02:53:28 +0000 (21:53 -0500)]
Box docs: no allocation is done for ZSTs.

7 years agoAuto merge of #40371 - arielb1:bean-counter, r=alexcrichton
bors [Thu, 9 Mar 2017 00:20:25 +0000 (00:20 +0000)]
Auto merge of #40371 - arielb1:bean-counter, r=alexcrichton

add some disk usage accounting

Try to figure out why we are out of free space

r? @alexcrichton

7 years agoadd some disk usage accounting
Ariel Ben-Yehuda [Wed, 8 Mar 2017 20:19:33 +0000 (22:19 +0200)]
add some disk usage accounting

Try to figure out why we are out of free space

7 years agofix UB in repr(packed) tests
Tim Neumann [Wed, 8 Mar 2017 20:17:55 +0000 (21:17 +0100)]
fix UB in repr(packed) tests

7 years agoRollup merge of #40335 - tbu-:pr_doc_str_to_somecase, r=steveklabnik
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:10 +0000 (20:54 +0200)]
Rollup merge of #40335 - tbu-:pr_doc_str_to_somecase, r=steveklabnik

Document why `str.to_{lower,upper}case` return `String`

Fixes #39201.

7 years agoRollup merge of #40333 - tbu-:pr_doc_ptr_write, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:08 +0000 (20:54 +0200)]
Rollup merge of #40333 - tbu-:pr_doc_ptr_write, r=alexcrichton

Clarify handling of `src` in `ptr::write`

Fixes #39733.

7 years agoRollup merge of #40327 - GuillaumeGomez:macros-urls, r=frewsxcv
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:07 +0000 (20:54 +0200)]
Rollup merge of #40327 - GuillaumeGomez:macros-urls, r=frewsxcv

Add missing urls in some macros doc

r? @frewsxcv

7 years agoRollup merge of #40326 - crazymerlyn:fix-doc-link, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:06 +0000 (20:54 +0200)]
Rollup merge of #40326 - crazymerlyn:fix-doc-link, r=alexcrichton

Update link to COMPILER_TESTS.md in CONTRIBUTING.md

Link to compiler test documentation was broken after the file was moved by #40086.
This updates the link to the new location of the file.

7 years agoRollup merge of #40325 - eddyb:pr38143, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:05 +0000 (20:54 +0200)]
Rollup merge of #40325 - eddyb:pr38143, r=alexcrichton

Added remove_from to vec.rs (#38143)

Turns out that if you push to someone's PR branch and cause the PR to close, you lose delegation 😞.

@madseagames I'm really sorry about that 😭

7 years agoRollup merge of #40321 - joelgallant:joelgallant-readme, r=aturon
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:03 +0000 (20:54 +0200)]
Rollup merge of #40321 - joelgallant:joelgallant-readme, r=aturon

README formatting in configure/make section

Tiny change to render the `config.mk` correctly

7 years agoRollup merge of #40316 - oli-obk:patch-4, r=GuillaumeGomez
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:02 +0000 (20:54 +0200)]
Rollup merge of #40316 - oli-obk:patch-4, r=GuillaumeGomez

Fix a typo in the docs

7 years agoRollup merge of #40296 - topecongiro:add-missing-tests, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:01 +0000 (20:54 +0200)]
Rollup merge of #40296 - topecongiro:add-missing-tests, r=alexcrichton

Add tests for issues with the 'E-needtest' label.

This PR adds tests for the following issues:

7 years agoRollup merge of #40293 - malbarbo:rustdoctest, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:54:00 +0000 (20:54 +0200)]
Rollup merge of #40293 - malbarbo:rustdoctest, r=alexcrichton

Remove extra space in test description (of a mod test)

7 years agoRollup merge of #40292 - mmatyas:readme_fix, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:59 +0000 (20:53 +0200)]
Rollup merge of #40292 - mmatyas:readme_fix, r=alexcrichton

Fix text formatting in README

There was a missing backtick in the README.