]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoFix ref-to-ptr coercions not working with NLL in certain cases
Aaron Hill [Tue, 30 Jan 2018 04:15:38 +0000 (23:15 -0500)]
Fix ref-to-ptr coercions not working with NLL in certain cases

Implicit coercions from references to pointers were lowered to slightly
different Mir than explicit casts (e.g. 'foo as *mut T'). This resulted
in certain uses of self-referential structs compiling correctly when an
explicit cast was used, but not when the implicit coercion was used.

To fix this, this commit adds an outer 'Use' expr when applying a
raw-ptr-borrow adjustment. This makes the lowered Mir for coercions
identical to that of explicit coercions, allowing the original code to
compile regardless of how the raw ptr cast occurs.

Fixes #47722

6 years agoAuto merge of #47837 - eddyb:going-places, r=nikomatsakis
bors [Mon, 29 Jan 2018 19:47:48 +0000 (19:47 +0000)]
Auto merge of #47837 - eddyb:going-places, r=nikomatsakis

Replace "lvalue" terminology with "place".

See #46425 for the previous PR (which only changed MIR-related code).

r? @nikomatsakis

6 years agoAuto merge of #47766 - spastorino:inference-dirty-list, r=nikomatsakis
bors [Mon, 29 Jan 2018 10:51:07 +0000 (10:51 +0000)]
Auto merge of #47766 - spastorino:inference-dirty-list, r=nikomatsakis

Make region inference use a dirty list

r? @nikomatsakis

6 years agorustc_borrowck: replace "lvalue" terminology with "place" in docs.
Eduard-Mihai Burtescu [Mon, 29 Jan 2018 00:25:35 +0000 (02:25 +0200)]
rustc_borrowck: replace "lvalue" terminology with "place" in docs.

6 years agotests: replace "lvalue" terminology with "place".
Eduard-Mihai Burtescu [Sun, 28 Jan 2018 23:59:34 +0000 (01:59 +0200)]
tests: replace "lvalue" terminology with "place".

6 years agoAuto merge of #47730 - alexcrichton:multitrans, r=Mark-Simulacrum
bors [Mon, 29 Jan 2018 04:55:47 +0000 (04:55 +0000)]
Auto merge of #47730 - alexcrichton:multitrans, r=Mark-Simulacrum

rustc: Split Emscripten to a separate codegen backend

This commit introduces a separately compiled backend for Emscripten, avoiding
compiling the `JSBackend` target in the main LLVM codegen backend. This builds
on the foundation provided by #47671 to create a new codegen backend dedicated
solely to Emscripten, removing the `JSBackend` of the main codegen backend in
the process.

A new field was added to each target for this commit which specifies the backend
to use for translation, the default being `llvm` which is the main backend that
we use. The Emscripten targets specify an `emscripten` backend instead of the
main `llvm` one.

There's a whole bunch of consequences of this change, but I'll try to enumerate
them here:

* A *second* LLVM submodule was added in this commit. The main LLVM submodule
  will soon start to drift from the Emscripten submodule, but currently they're
  both at the same revision.
* Logic was added to rustbuild to *not* build the Emscripten backend by default.
  This is gated behind a `--enable-emscripten` flag to the configure script. By
  default users should neither check out the emscripten submodule nor compile
  it.
* The `init_repo.sh` script was updated to fetch the Emscripten submodule from
  GitHub the same way we do the main LLVM submodule (a tarball fetch).
* The Emscripten backend, turned off by default, is still turned on for a number
  of targets on CI. We'll only be shipping an Emscripten backend with Tier 1
  platforms, though. All cross-compiled platforms will not be receiving an
  Emscripten backend yet.

This commit means that when you download the `rustc` package in Rustup for Tier
1 platforms you'll be receiving two trans backends, one for Emscripten and one
that's the general LLVM backend. If you never compile for Emscripten you'll
never use the Emscripten backend, so we may update this one day to only download
the Emscripten backend when you add the Emscripten target. For now though it's
just an extra 10MB gzip'd.

Closes #46819

6 years agorustc: Split Emscripten to a separate codegen backend
Alex Crichton [Wed, 24 Jan 2018 16:22:34 +0000 (08:22 -0800)]
rustc: Split Emscripten to a separate codegen backend

This commit introduces a separately compiled backend for Emscripten, avoiding
compiling the `JSBackend` target in the main LLVM codegen backend. This builds
on the foundation provided by #47671 to create a new codegen backend dedicated
solely to Emscripten, removing the `JSBackend` of the main codegen backend in
the process.

A new field was added to each target for this commit which specifies the backend
to use for translation, the default being `llvm` which is the main backend that
we use. The Emscripten targets specify an `emscripten` backend instead of the
main `llvm` one.

There's a whole bunch of consequences of this change, but I'll try to enumerate
them here:

* A *second* LLVM submodule was added in this commit. The main LLVM submodule
  will soon start to drift from the Emscripten submodule, but currently they're
  both at the same revision.
* Logic was added to rustbuild to *not* build the Emscripten backend by default.
  This is gated behind a `--enable-emscripten` flag to the configure script. By
  default users should neither check out the emscripten submodule nor compile
  it.
* The `init_repo.sh` script was updated to fetch the Emscripten submodule from
  GitHub the same way we do the main LLVM submodule (a tarball fetch).
* The Emscripten backend, turned off by default, is still turned on for a number
  of targets on CI. We'll only be shipping an Emscripten backend with Tier 1
  platforms, though. All cross-compiled platforms will not be receiving an
  Emscripten backend yet.

This commit means that when you download the `rustc` package in Rustup for Tier
1 platforms you'll be receiving two trans backends, one for Emscripten and one
that's the general LLVM backend. If you never compile for Emscripten you'll
never use the Emscripten backend, so we may update this one day to only download
the Emscripten backend when you add the Emscripten target. For now though it's
just an extra 10MB gzip'd.

Closes #46819

6 years agorustc: replace "lvalue" terminology with "place" in the code.
Eduard-Mihai Burtescu [Sun, 28 Jan 2018 23:49:29 +0000 (01:49 +0200)]
rustc: replace "lvalue" terminology with "place" in the code.

6 years agoAuto merge of #47663 - malbarbo:mips-crt-static, r=alexcrichton
bors [Sun, 28 Jan 2018 23:30:15 +0000 (23:30 +0000)]
Auto merge of #47663 - malbarbo:mips-crt-static, r=alexcrichton

Do not assume dynamic linking for musl/mips[el] targets

All musl targets except mips[el] assume static linking by default. This can be [confusing](https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084).

When the musl/mips[el] targets was [added](https://github.com/rust-lang/rust/pull/31298), dynamic linking was chosen because of binary size concerns, and probably also because libunwind [didn't](https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084/8) supported mips.

Now that we have `crt-static` target-feature (the user can choose dynamic link for musl targets), and libunwind [6.0](https://github.com/llvm-mirror/libunwind/commits/release_60) add support to mips, we do not need to assume dynamic linking.

6 years agorustc: move `expr_is_lval` to rustc_typeck and rename to `is_place_expr`.
Eduard-Mihai Burtescu [Sun, 28 Jan 2018 23:16:02 +0000 (01:16 +0200)]
rustc: move `expr_is_lval` to rustc_typeck and rename to `is_place_expr`.

6 years agorustc_typeck: rename `LvalueOp` to `PlaceOp`.
Eduard-Mihai Burtescu [Sun, 28 Jan 2018 22:55:39 +0000 (00:55 +0200)]
rustc_typeck: rename `LvalueOp` to `PlaceOp`.

6 years agorustc_typeck: rename `LvaluePreference::PreferMutLvalue` to `Needs::MutPlace`.
Eduard-Mihai Burtescu [Sun, 28 Jan 2018 22:51:34 +0000 (00:51 +0200)]
rustc_typeck: rename `LvaluePreference::PreferMutLvalue` to `Needs::MutPlace`.

6 years agorustc: remove `LvaluePreference` argument from `Ty::builtin_deref`.
Eduard-Mihai Burtescu [Sun, 28 Jan 2018 21:29:40 +0000 (23:29 +0200)]
rustc: remove `LvaluePreference` argument from `Ty::builtin_deref`.

6 years agoAuto merge of #47204 - varkor:unsafecell-into_inner-safe, r=alexcrichton
bors [Sun, 28 Jan 2018 19:01:51 +0000 (19:01 +0000)]
Auto merge of #47204 - varkor:unsafecell-into_inner-safe, r=alexcrichton

Make UnsafeCell::into_inner safe

This fixes #35067. It will require a Crater run as discussed in that
issue.

6 years agoAuto merge of #47800 - Pulkit07:issue47755, r=sfackler
bors [Sun, 28 Jan 2018 16:17:18 +0000 (16:17 +0000)]
Auto merge of #47800 - Pulkit07:issue47755, r=sfackler

don't mention tasks in stability warnings of #[thread_local] #47755

This is a fix for issue #47755.

6 years agoAuto merge of #47794 - etaoins:fix-ice-on-const-eval-of-union-field, r=eddyb
bors [Sun, 28 Jan 2018 13:24:47 +0000 (13:24 +0000)]
Auto merge of #47794 - etaoins:fix-ice-on-const-eval-of-union-field, r=eddyb

Fix ICE on const eval of union field

MIR's `Const::get_field()` attempts to retrieve the value for a given field in a constant. In the case of a union constant it was falling through to a generic `const_get_elt` based on the field index. As union fields don't have an index this caused an ICE in `llvm_field_index`.

Fix by simply returning the current value when accessing any field in a union. This works because all union fields start at byte offset 0.

The added test uses `const_fn` it ensure the field is extracted using MIR's const evaluation. The crash is reproducible without it, however.

Fixes #47788

r? @eddyb

6 years agoAuto merge of #47772 - arthurprs:iter-position-bounds-check, r=dtolnay
bors [Sun, 28 Jan 2018 10:41:34 +0000 (10:41 +0000)]
Auto merge of #47772 - arthurprs:iter-position-bounds-check, r=dtolnay

Use the slice length to hint the optimizer about iter.position result

Using the len of the iterator doesn't give the same result.
That's also why we can't generalize it to all TrustedLen iterators.

Problem demo: https://godbolt.org/g/MXg2ae
Fix demo: https://godbolt.org/g/P8q5aZ

Second attempt of #47333
Third attempt of #45501
Fixes #45964

6 years agoAuto merge of #47767 - estebank:as-suggestion, r=petrochenkov
bors [Sun, 28 Jan 2018 07:44:14 +0000 (07:44 +0000)]
Auto merge of #47767 - estebank:as-suggestion, r=petrochenkov

Correctly format `extern crate` conflict resolution help

Closes #45799. Follow up to @Cldfire's #45820.

If the `extern` statement that will have a suggestion ends on a `;`, synthesize a new span that doesn't include it.

6 years agoAuto merge of #47671 - alexcrichton:trans-c-api-only, r=Mark-Simulacrum
bors [Sun, 28 Jan 2018 03:40:26 +0000 (03:40 +0000)]
Auto merge of #47671 - alexcrichton:trans-c-api-only, r=Mark-Simulacrum

rustc: Load the `rustc_trans` crate at runtime

Building on the work of #45684 this commit updates the compiler to
unconditionally load the `rustc_trans` crate at runtime instead of linking to it
at compile time. The end goal of this work is to implement #46819 where rustc
will have multiple backends available to it to load.

This commit starts off by removing the `extern crate rustc_trans` from the
driver. This involved moving some miscellaneous functionality into the
`TransCrate` trait and also required an implementation of how to locate and load
the trans backend. This ended up being a little tricky because the sysroot isn't
always the right location (for example `--sysroot` arguments) so some extra code
was added as well to probe a directory relative to the current dll (the
rustc_driver dll).

Rustbuild has been updated accordingly as well to have a separate compilation
invocation for the `rustc_trans` crate and assembly it accordingly into the
sysroot. Finally, the distribution logic for the `rustc` package was also
updated to slurp up the trans backends folder.

A number of assorted fallout changes were included here as well to ensure tests
pass and such, and they should all be commented inline.

6 years agorustc: Load the `rustc_trans` crate at runtime
Alex Crichton [Mon, 22 Jan 2018 15:29:24 +0000 (07:29 -0800)]
rustc: Load the `rustc_trans` crate at runtime

Building on the work of # 45684 this commit updates the compiler to
unconditionally load the `rustc_trans` crate at runtime instead of linking to it
at compile time. The end goal of this work is to implement # 46819 where rustc
will have multiple backends available to it to load.

This commit starts off by removing the `extern crate rustc_trans` from the
driver. This involved moving some miscellaneous functionality into the
`TransCrate` trait and also required an implementation of how to locate and load
the trans backend. This ended up being a little tricky because the sysroot isn't
always the right location (for example `--sysroot` arguments) so some extra code
was added as well to probe a directory relative to the current dll (the
rustc_driver dll).

Rustbuild has been updated accordingly as well to have a separate compilation
invocation for the `rustc_trans` crate and assembly it accordingly into the
sysroot. Finally, the distribution logic for the `rustc` package was also
updated to slurp up the trans backends folder.

A number of assorted fallout changes were included here as well to ensure tests
pass and such, and they should all be commented inline.

6 years agoAuto merge of #47746 - varkor:never-type-ice, r=nikomatsakis
bors [Sun, 28 Jan 2018 00:40:10 +0000 (00:40 +0000)]
Auto merge of #47746 - varkor:never-type-ice, r=nikomatsakis

Fix never-type rvalue ICE

This fixes #43061.
r? @nikomatsakis

A small post-mortem as a follow-up to our investigations in https://github.com/rust-lang/rust/pull/47291:
The problem as I understand it is that when `NeverToAny` coercions are made, the expression/statement that is coerced may be enclosed in a block. In our case, the statement `x;` was being transformed to something like: `NeverToAny( {x;} )`. Then, `NeverToAny` is transformed into an expression:
https://github.com/rust-lang/rust/blob/000fbbc9b8f88adc6a417f1caef41161f104250f/src/librustc_mir/build/expr/into.rs#L52-L59
Which ends up calling `ast_block_stmts` on the block `{x;}`, which triggers this condition:
https://github.com/rust-lang/rust/blob/000fbbc9b8f88adc6a417f1caef41161f104250f/src/librustc_mir/build/block.rs#L141-L147
In our case, there is no return expression, so `push_assign_unit` is called. But the block has already been recorded as _diverging_, meaning the result of the block will be assigned to a location of type `!`, rather than `()`. This causes the MIR error.
I'm assuming the `NeverToAny` coercion code is doing what it's supposed to (there don't seem to be any other problems), so fixing the issue simply consists of checking that the destination for the return value actually _is_ supposed to be a unit. (If no return value is given, the only other possible type for the return value is `!`, which can just be ignored, as it will be unreachable anyway.)

I checked the other cases of `push_assign_unit`, and it didn't look like they could be affected by the divergence issue (blocks are kind of special-cased in this regard as far as I can tell), so this should be sufficient to fix the issue.

6 years agoRemove musl/libunwind patch for i686
Marco A L Barbosa [Sat, 27 Jan 2018 22:57:10 +0000 (20:57 -0200)]
Remove musl/libunwind patch for i686

The i686 problem was fixed upstream:
https://github.com/llvm-mirror/libunwind/commit/aa805e415f19f50ebc6f5e1e1e4bf9bb7f61816b

6 years agoAuto merge of #47420 - davidtwco:issue-46885, r=estebank
bors [Sat, 27 Jan 2018 19:41:40 +0000 (19:41 +0000)]
Auto merge of #47420 - davidtwco:issue-46885, r=estebank

Fix off-by-one spans in MIR borrowck errors

Fixes #46885.

r? @nikomatsakis

6 years agoFixed infinite loop issues and added some improved logging.
David Wood [Sat, 27 Jan 2018 13:30:34 +0000 (13:30 +0000)]
Fixed infinite loop issues and added some improved logging.

6 years agoNow handling case where span has same lo and hi.
David Wood [Wed, 17 Jan 2018 16:41:58 +0000 (16:41 +0000)]
Now handling case where span has same lo and hi.

6 years agoFix new test from rebase.
David Wood [Wed, 17 Jan 2018 14:30:16 +0000 (14:30 +0000)]
Fix new test from rebase.

6 years agonext_point now handles creating spans over multibyte characters.
David Wood [Wed, 17 Jan 2018 10:01:57 +0000 (10:01 +0000)]
next_point now handles creating spans over multibyte characters.

6 years agoReplaced multi-byte character handling in end_point with potentially more performant...
David Wood [Tue, 16 Jan 2018 20:41:00 +0000 (20:41 +0000)]
Replaced multi-byte character handling in end_point with potentially more performant variant.

6 years agoend_point handling multibyte characters correctly.
David Wood [Sun, 14 Jan 2018 17:29:07 +0000 (17:29 +0000)]
end_point handling multibyte characters correctly.

6 years agoMoved overflow check into end_point function.
David Wood [Sun, 14 Jan 2018 00:23:35 +0000 (00:23 +0000)]
Moved overflow check into end_point function.

6 years agoFixed off-by-one spans in MIR borrowck errors.
David Wood [Sat, 13 Jan 2018 23:28:42 +0000 (23:28 +0000)]
Fixed off-by-one spans in MIR borrowck errors.

6 years agoUpdated tests with fixed span location.
David Wood [Sat, 13 Jan 2018 23:28:00 +0000 (23:28 +0000)]
Updated tests with fixed span location.

6 years agoAuto merge of #46450 - Gilnaa:libtest_json_output, r=nrc
bors [Sat, 27 Jan 2018 10:56:56 +0000 (10:56 +0000)]
Auto merge of #46450 - Gilnaa:libtest_json_output, r=nrc

Libtest json output

A revisit to my [last PR](https://github.com/rust-lang/rust/pull/45923).

Events are now more atomic, printed in a flat hierarchy.

For the normal test output:
```
running 1 test
test f ... FAILED

failures:

---- f stdout ----
thread 'f' panicked at 'assertion failed: `(left == right)`
  left: `3`,
 right: `4`', f.rs:3:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.

failures:
    f

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
```

The JSON equivalent is:
```
{ "type": "suite", "event": "started", "test_count": "1" }
{ "type": "test", "event": "started", "name": "f" }
{ "type": "test", "event": "failed", "name": "f" }
{ "type": "suite", "event": "failed", "passed": 0, "failed": 1, "allowed_fail": 0, "ignored": 0,  "measured": 0, "filtered_out": "0" }
{ "type": "test_output", "name": "f", "output": "thread 'f' panicked at 'assertion failed: `(left == right)`
  left: `3`,
 right: `4`', f.rs:3:1
note: Run with `RUST_BACKTRACE=1` for a backtrace.
" }
```

6 years agolibtest: Fixed call to python in run-make
Gilad Naaman [Sat, 27 Jan 2018 09:50:01 +0000 (11:50 +0200)]
libtest: Fixed call to python in run-make

6 years agoAuto merge of #47690 - estebank:for-block-277, r=nikomatsakis
bors [Sat, 27 Jan 2018 08:04:12 +0000 (08:04 +0000)]
Auto merge of #47690 - estebank:for-block-277, r=nikomatsakis

For E0277 on `for` loops, point at the "head" expression

When E0277's span points at a `for` loop, the actual issue is in the
element being iterated. Instead of pointing at the entire loop, point
only at the first line (when possible) so that the span ends in the
element for which E0277 was triggered.

6 years agodon't mention tasks in stability warnings of #[thread_local] #47755
Pulkit Goyal [Sat, 27 Jan 2018 07:58:09 +0000 (13:28 +0530)]
don't mention tasks in stability warnings of #[thread_local] #47755

This is a fix for issue #47755.

6 years agoExpand union test to include different types
Ryan Cumming [Sat, 27 Jan 2018 03:18:18 +0000 (14:18 +1100)]
Expand union test to include different types

6 years agoFix ICE on const eval of union field
Ryan Cumming [Sat, 27 Jan 2018 01:14:12 +0000 (12:14 +1100)]
Fix ICE on const eval of union field

MIR's `Const::get_field()` attempts to retrieve the value for a given
field in a constant. In the case of a union constant it was falling
through to a generic `const_get_elt` based on the field index. As union
fields don't have an index this caused an ICE in `llvm_field_index`.

Fix by simply returning the current value when accessing any field in a
union. This works because all union fields start at byte offset 0.

The added test uses `const_fn` it ensure the field is extracted using
MIR's const evaluation. The crash is reproducible without it, however.

Fixes #47788

6 years agopacify the mercilous tidy
Niko Matsakis [Sat, 27 Jan 2018 01:51:40 +0000 (20:51 -0500)]
pacify the mercilous tidy

6 years agochange from `dirty_bit_vec` to `clean_bit_vec`
Niko Matsakis [Sat, 27 Jan 2018 01:13:51 +0000 (20:13 -0500)]
change from `dirty_bit_vec` to `clean_bit_vec`

Otherwise the vector is initially out of sync

6 years agoAdjust comment spacing
Niko Matsakis [Sat, 27 Jan 2018 00:58:54 +0000 (19:58 -0500)]
Adjust comment spacing

I suspect the lines would be long for tidy.

6 years agoMake region inference use a dirty list
Santiago Pastorino [Fri, 26 Jan 2018 05:14:54 +0000 (02:14 -0300)]
Make region inference use a dirty list

Fixes #47602

6 years agoAuto merge of #47571 - FenrirWolf:libunwind, r=alexcrichton
bors [Sat, 27 Jan 2018 00:28:34 +0000 (00:28 +0000)]
Auto merge of #47571 - FenrirWolf:libunwind, r=alexcrichton

Match libunwind's EABI selection with libpanic_unwind

Currently, the `libunwind` crate will only select the ARM EABI if it is compiling for ARM/Linux or Android targets. `libpanic_unwind`, however, will choose the ARM EABI if the target arch is ARM and the OS is not iOS. This means that if one tries to enable unwinding for a non-standard ARM target (such as implementing a custom stdlib via Xargo, for example), then the two crates can potentially disagree about which EABI is being targeted.

This PR makes `libunwind` use the [same logic](https://github.com/rust-lang/rust/blob/master/src/libpanic_unwind/gcc.rs#L139-L146) as `libpanic_unwind` when choosing the EABI.

I noticed there are a few comments about certain functions only differing on Android or ARM/Linux, but I *think* that those differences apply to the ARM EABI in general. Let me know if I'm wrong about that.

6 years agoInstead of modifying the item's span synthesize it
Esteban Küber [Fri, 26 Jan 2018 06:40:38 +0000 (22:40 -0800)]
Instead of modifying the item's span synthesize it

6 years agoDon't add "in this macro invocation" label to desugared spans
Esteban Küber [Fri, 26 Jan 2018 19:34:12 +0000 (11:34 -0800)]
Don't add "in this macro invocation" label to desugared spans

6 years agoModify spans of expanded expression
Esteban Küber [Thu, 25 Jan 2018 22:07:45 +0000 (14:07 -0800)]
Modify spans of expanded expression

Modify the spans used for `for`-loop expression expansion, instead of
creating a new span during error creation.

6 years agoUpdated Cargo commit hash
Gilad Naaman [Fri, 26 Jan 2018 17:57:02 +0000 (19:57 +0200)]
Updated Cargo commit hash

6 years agolibtest: Failing benchmarks no longer crash the harness.
Gilad Naaman [Mon, 22 Jan 2018 20:29:41 +0000 (22:29 +0200)]
libtest: Failing benchmarks no longer crash the harness.

6 years agolibtest: Split-up formatters.rs into smaller modules
Gilad Naaman [Tue, 19 Dec 2017 21:12:24 +0000 (23:12 +0200)]
libtest: Split-up formatters.rs into smaller modules

libtest: Split HumanFormatter into {Pretty,Terse}

libtest: Fixed padding of benchmarks when not benchmarking

libtest: Fixed benchmarks' names not showing in terse-mode

libtest: Formatting

6 years agolibtest: Added UI tests for --format=json
Gilad Naaman [Tue, 19 Dec 2017 12:44:18 +0000 (14:44 +0200)]
libtest: Added UI tests for --format=json

libtest: Remove usage of jq

libtest: Fixed UI tests

- Now comparing to the right file.
- A python script checks for validity of JSON documents

6 years agolibtest: rustfmt run
Gilad Naaman [Fri, 15 Dec 2017 15:32:00 +0000 (17:32 +0200)]
libtest: rustfmt run

libtest: Whoops

6 years agolibtest: Fixed pretty-printing of test names in single-threaded code.
Gilad Naaman [Fri, 15 Dec 2017 15:25:44 +0000 (17:25 +0200)]
libtest: Fixed pretty-printing of test names in single-threaded code.

6 years agolibtest: JSON formatting is now only available in unstable builds
Gilad Naaman [Wed, 13 Dec 2017 19:12:19 +0000 (21:12 +0200)]
libtest: JSON formatting is now only available in unstable builds

libtest: Added the -Z option for unstable options

6 years agoAdded JSON output to libtest.
Gilad Naaman [Fri, 10 Nov 2017 12:00:55 +0000 (14:00 +0200)]
Added JSON output to libtest.

libtest: Json format now outputs failed tests' stdouts.

libtest: Json format now outputs failed tests' stdouts.

libtest: Json formatter now spews individiual events, not as an array

libtest: JSON fixes

libtest: Better JSON escaping

libtest: Test start event is printed on time

6 years agoRefactoring needed in order to have test json output.
Gilad Naaman [Wed, 8 Nov 2017 04:06:16 +0000 (06:06 +0200)]
Refactoring needed in order to have test json output.

6 years agoAuto merge of #47748 - alexcrichton:rollup, r=alexcrichton
bors [Fri, 26 Jan 2018 17:41:36 +0000 (17:41 +0000)]
Auto merge of #47748 - alexcrichton:rollup, r=alexcrichton

Rollup of 19 pull requests

- Successful merges: #47415, #47437, #47439, #47453, #47460, #47502, #47529, #47600, #47607, #47618, #47626, #47656, #47668, #47696, #47701, #47705, #47710, #47711, #47719
- Failed merges: #47455, #47521

6 years agoIgnore a test on emscripten
Alex Crichton [Fri, 26 Jan 2018 17:41:00 +0000 (09:41 -0800)]
Ignore a test on emscripten

6 years agoAdd clarifying comment regarding the trailing type of a block
varkor [Fri, 26 Jan 2018 15:39:19 +0000 (15:39 +0000)]
Add clarifying comment regarding the trailing type of a block

6 years agoFix a test case on Windows
Alex Crichton [Fri, 26 Jan 2018 15:37:57 +0000 (07:37 -0800)]
Fix a test case on Windows

6 years agoMerge branch 'mlsm' of https://github.com/dotdash/rust into rollup
Alex Crichton [Fri, 26 Jan 2018 14:53:18 +0000 (06:53 -0800)]
Merge branch 'mlsm' of https://github.com/dotdash/rust into rollup

6 years agoMerge branch 'beta-prerelease' of https://github.com/cuviper/rust into rollup
Alex Crichton [Fri, 26 Jan 2018 14:52:55 +0000 (06:52 -0800)]
Merge branch 'beta-prerelease' of https://github.com/cuviper/rust into rollup

6 years agoMerge branch 'android-run-pass' of https://github.com/malbarbo/rust into rollup
Alex Crichton [Fri, 26 Jan 2018 14:52:36 +0000 (06:52 -0800)]
Merge branch 'android-run-pass' of https://github.com/malbarbo/rust into rollup

6 years agoMerge branch 'fix-regression' of https://github.com/estebank/rust into rollup
Alex Crichton [Fri, 26 Jan 2018 14:52:21 +0000 (06:52 -0800)]
Merge branch 'fix-regression' of https://github.com/estebank/rust into rollup

6 years agoMerge branch 'rustdoc_masked' of https://github.com/ollie27/rust into rollup
Alex Crichton [Fri, 26 Jan 2018 14:51:58 +0000 (06:51 -0800)]
Merge branch 'rustdoc_masked' of https://github.com/ollie27/rust into rollup

6 years agoMerge branch 'simd-always-mem' of https://github.com/alexcrichton/rust into rollup
Alex Crichton [Fri, 26 Jan 2018 14:51:43 +0000 (06:51 -0800)]
Merge branch 'simd-always-mem' of https://github.com/alexcrichton/rust into rollup

6 years agoMerge branch 'llvm5-indirect-deref' of https://github.com/cuviper/rust into rollup
Alex Crichton [Fri, 26 Jan 2018 14:51:14 +0000 (06:51 -0800)]
Merge branch 'llvm5-indirect-deref' of https://github.com/cuviper/rust into rollup

6 years agoMerge branch 'explain' of https://github.com/estebank/rust into rollup
Alex Crichton [Fri, 26 Jan 2018 14:50:31 +0000 (06:50 -0800)]
Merge branch 'explain' of https://github.com/estebank/rust into rollup

6 years agoMerge branch 'no-stderr-sink' of https://github.com/Zoxc/rust into rollup
Alex Crichton [Fri, 26 Jan 2018 14:49:55 +0000 (06:49 -0800)]
Merge branch 'no-stderr-sink' of https://github.com/Zoxc/rust into rollup

6 years agoShorten another test path for MSVC
Alex Crichton [Fri, 26 Jan 2018 14:48:38 +0000 (06:48 -0800)]
Shorten another test path for MSVC

6 years agoAuto merge of #47252 - Zoxc:backtrace-win, r=alexcrichton
bors [Fri, 26 Jan 2018 12:18:00 +0000 (12:18 +0000)]
Auto merge of #47252 - Zoxc:backtrace-win, r=alexcrichton

Print inlined functions on Windows

Split from https://github.com/rust-lang/rust/pull/45637

r? @alexcrichton

6 years agoUse the slice length to hint the optimizer
arthurprs [Fri, 26 Jan 2018 11:49:14 +0000 (12:49 +0100)]
Use the slice length to hint the optimizer

Using the len of the iterator doesn't give the same result.
That's also why we can't generalize it to all TrustedLen iterators.

6 years agoUpgrade LLVM to incorporate a fix for #47364
Björn Steinbrink [Fri, 26 Jan 2018 08:53:48 +0000 (09:53 +0100)]
Upgrade LLVM to incorporate a fix for #47364

Fixes #47364

6 years agoCorrectly format `extern crate` conflict resolution help
Cldfire [Tue, 7 Nov 2017 02:40:21 +0000 (21:40 -0500)]
Correctly format `extern crate` conflict resolution help

6 years agoIgnore an i128 test on emscripten
Alex Crichton [Fri, 26 Jan 2018 05:04:01 +0000 (21:04 -0800)]
Ignore an i128 test on emscripten

6 years agoAuto merge of #47676 - topecongiro:update-rls, r=alexcrichton
bors [Fri, 26 Jan 2018 04:10:10 +0000 (04:10 +0000)]
Auto merge of #47676 - topecongiro:update-rls, r=alexcrichton

Update rls

Currently rls is missing from the latest nightly component. This PR brings it back.

6 years agoUpdate rls
topecongiro [Fri, 26 Jan 2018 03:55:22 +0000 (12:55 +0900)]
Update rls

6 years agoDo not capture stderr in the compiler. Instead just panic silently for fatal errors
John Kåre Alsaker [Sun, 21 Jan 2018 11:47:58 +0000 (12:47 +0100)]
Do not capture stderr in the compiler. Instead just panic silently for fatal errors

6 years agoPrint inlined functions on Windows
John Kåre Alsaker [Wed, 15 Nov 2017 17:01:09 +0000 (18:01 +0100)]
Print inlined functions on Windows

6 years agoShorten a filename for MSVC
Alex Crichton [Fri, 26 Jan 2018 02:11:42 +0000 (18:11 -0800)]
Shorten a filename for MSVC

6 years agoCall non-git beta builds simply x.y.z-beta
Josh Stone [Fri, 26 Jan 2018 00:22:58 +0000 (16:22 -0800)]
Call non-git beta builds simply x.y.z-beta

We can't use git commands to compute a prerelease version when we're
building from a source tarball, or if git is otherwise unavailable.
We'll just call such builds `x.y.z-beta`, without a prerelease.

6 years agoRevert update of the i686-freebsd builder
Alex Crichton [Thu, 25 Jan 2018 22:53:30 +0000 (14:53 -0800)]
Revert update of the i686-freebsd builder

Looks like llvm 4.0.0 isn't read for that either.

6 years agoRemove stray src/llvm-emscripten module
Alex Crichton [Thu, 25 Jan 2018 20:46:45 +0000 (12:46 -0800)]
Remove stray src/llvm-emscripten module

Accidentally added in e9a64996b

6 years agoMerge branch 'configure-lto' of https://github.com/alexcrichton/rust into rollup
Alex Crichton [Thu, 25 Jan 2018 18:51:20 +0000 (10:51 -0800)]
Merge branch 'configure-lto' of https://github.com/alexcrichton/rust into rollup

6 years agoMerge branch 'cache-ty-collect' of https://github.com/michaelwoerister/rust into...
Alex Crichton [Thu, 25 Jan 2018 18:50:35 +0000 (10:50 -0800)]
Merge branch 'cache-ty-collect' of https://github.com/michaelwoerister/rust into rollup

6 years agoRollup merge of #47719 - malbarbo:run-pass-arch-powerpc, r=alexcrichton
Alex Crichton [Thu, 25 Jan 2018 18:49:03 +0000 (12:49 -0600)]
Rollup merge of #47719 - malbarbo:run-pass-arch-powerpc, r=alexcrichton

Add powerpc to run-pass/conditional-compile-arch.rs

6 years agoRollup merge of #47711 - alexcrichton:update-compiler-builtins, r=nikomatsakis
Alex Crichton [Thu, 25 Jan 2018 18:49:02 +0000 (12:49 -0600)]
Rollup merge of #47711 - alexcrichton:update-compiler-builtins, r=nikomatsakis

Update compiler-builtins submodule

No sense of urgency, just wanted to make sure we don't lag too far behind!

6 years agoRollup merge of #47710 - alexcrichton:llvm-6-compat, r=nikomatsakis
Alex Crichton [Thu, 25 Jan 2018 18:49:01 +0000 (12:49 -0600)]
Rollup merge of #47710 - alexcrichton:llvm-6-compat, r=nikomatsakis

First round of LLVM 6.0.0 compatibility

This includes a number of commits for the first round of upgrading to LLVM 6. There are still [lingering bugs](https://github.com/rust-lang/rust/issues/47683) but I believe all of this will nonetheless be necessary!

6 years agoRollup merge of #47705 - pietroalbini:fix-47673, r=petrochenkov
Alex Crichton [Thu, 25 Jan 2018 18:49:00 +0000 (12:49 -0600)]
Rollup merge of #47705 - pietroalbini:fix-47673, r=petrochenkov

Fix ICE when use trees have multiple empty nested groups

The issue was caused by an oversight of mine in the original use_nested_groups PR, where different paths were resolved with the same `NodeId` in some cases (such as in `use {{}, {}};`).

Fixes #47673
r? @petrochenkov

6 years agoRollup merge of #47701 - Manishearth:intra-fixes, r=QuietMisdreavus
Alex Crichton [Thu, 25 Jan 2018 18:48:59 +0000 (12:48 -0600)]
Rollup merge of #47701 - Manishearth:intra-fixes, r=QuietMisdreavus

Fixes for intra-doc-links

Turn errors into warnings, also handle methods, trait items, and variants.

r? @killercup @QuietMisdreavus

6 years agoRollup merge of #47696 - Zoxc:variance-rg, r=nikomatsakis
Alex Crichton [Thu, 25 Jan 2018 18:48:58 +0000 (12:48 -0600)]
Rollup merge of #47696 - Zoxc:variance-rg, r=nikomatsakis

Make use of the implemented red/green algorithm for variance

r? @michaelwoerister

6 years agoRollup merge of #47668 - nikomatsakis:issue-47511, r=eddyb
Alex Crichton [Thu, 25 Jan 2018 18:48:57 +0000 (12:48 -0600)]
Rollup merge of #47668 - nikomatsakis:issue-47511, r=eddyb

do not ICE when return type includes unconstrained anon region

It turns out that this *can* happen after all, if the region is only
used in projections from the input types.

Fixes https://github.com/rust-lang/rust/issues/47511

r? @eddyb

6 years agoRollup merge of #47656 - ishitatsuyuki:patch-1, r=nikomatsakis
Alex Crichton [Thu, 25 Jan 2018 18:48:56 +0000 (12:48 -0600)]
Rollup merge of #47656 - ishitatsuyuki:patch-1, r=nikomatsakis

[perf] Use std based dedup in projection

Unstable sort was added recently, and the code that is being modified is 3 years old. As quicksort doesn't allocate it will likely perform as well as, or better than linear search.

I didn't benchmark. Have a perf run.

6 years agoRollup merge of #47626 - eddyb:one-less-unwrap, r=nagisa
Alex Crichton [Thu, 25 Jan 2018 18:48:55 +0000 (12:48 -0600)]
Rollup merge of #47626 - eddyb:one-less-unwrap, r=nagisa

rustc_trans: remove an unwrap by replacing a bool with Result.

Prompted by @shepmaster.
r? @nagisa

6 years agoRollup merge of #47618 - mrhota:dw_at_noreturn, r=michaelwoerister
Alex Crichton [Thu, 25 Jan 2018 18:48:54 +0000 (12:48 -0600)]
Rollup merge of #47618 - mrhota:dw_at_noreturn, r=michaelwoerister

Teach rustc about DW_AT_noreturn and a few more DIFlags

We achieve two small things with this PR:
1. We provide definitions for a few additional llvm debuginfo flags
1. We _use_ one of these new flags, `FlagNoReturn`, and add it to debuginfo for functions with the never return type (`!`).

6 years agoMake 3 run-pass tests works on android (aarch64 and x86)
Marco A L Barbosa [Thu, 25 Jan 2018 19:31:35 +0000 (17:31 -0200)]
Make 3 run-pass tests works on android (aarch64 and x86)

6 years agorustc: SIMD types use pointers in Rust's ABI
Alex Crichton [Thu, 25 Jan 2018 16:00:22 +0000 (08:00 -0800)]
rustc: SIMD types use pointers in Rust's ABI

This commit changes the ABI of SIMD types in the "Rust" ABI to unconditionally
be passed via pointers instead of being passed as immediates. This should fix a
longstanding issue, #44367, where SIMD-using programs ended up showing very odd
behavior at runtime because the ABI between functions was mismatched.

As a bit of a recap, this is sort of an LLVM bug and sort of an LLVM feature
(today's behavior). LLVM will generate code for a function solely looking at the
function it's generating, including calls to other functions. Let's then say
you've got something that looks like:

```llvm
define void @foo() { ; no target features enabled
  call void @bar(<i64 x 4> zeroinitializer)
  ret void
}

define void @bar(<i64 x 4>) #0 { ; enables the AVX feature
  ...
}
```

LLVM will codegen the call to `bar` *without* using AVX registers becauase `foo`
doesn't have access to these registers. Instead it's generated with emulation
that uses two 128-bit registers. The `bar` function, on the other hand, will
expect its argument in an AVX register (as it has AVX enabled). This means we've
got a codegen problem!

Comments on #44367 have some more contexutal information but the crux of the
issue is that if we want SIMD to work in general we'll need to ensure that
whenever a function calls another they ABI of the arguments being passed is in
agreement.

One possible solution to this would be to insert "shim functions" where whenever
a `target_feature` mismatch is detected the compiler inserts a shim function
where you pass arguments via memory to the shim and then the shim loads the
values and calls the target function (where the shim and the target have the
same target features enabled). This unfortunately is quite nontrivial to
implement in rustc today (especially when accounting for function pointers and
such).

This commit takes a different solution, *always* passing SIMD arguments through
memory instead of passing as immediates. This strategy solves the problem at the
LLVM layer because the ABI between two functions never uses SIMD registers. This
also shouldn't be a hit to performance because SIMD performance is thought to
often rely on inlining anyway, where a `call` instruction, even if using SIMD
registers, would be disastrous to performance regardless. LLVM should then be
more than capable of fixing all our memory usage to use registers instead after
enough inlining has been performed.

Note that there's a few caveats to this commit though:

* The "platform intrinsic" ABI is omitted from "always pass via memory". This
  ABI is used to define intrinsics like `simd_shuffle4` where LLVM and rustc
  need to have the arguments as an immediate.

* Additionally this commit does *not* fix the `extern` ("C") ABI. This means
  that the bug in #44367 can still happen when using non-Rust-ABI functions. My
  hope is that before stabilization we can ban and/or warn about SIMD types in
  these functions (as AFAIK there's not much motivation to belong there anyway),
  but I'll leave that for a later commit and if this is merged I'll file a
  follow-up issue.

All in all this...

Closes #44367

6 years agoAdd description to field and method
Esteban Küber [Thu, 25 Jan 2018 19:40:33 +0000 (11:40 -0800)]
Add description to field and method

6 years agoFix regression: account for impl methods in arg count mismatch error
Esteban Küber [Thu, 25 Jan 2018 18:41:01 +0000 (10:41 -0800)]
Fix regression: account for impl methods in arg count mismatch error

6 years agoRollup merge of #47600 - varkor:empty-never-array, r=eddyb
Alex Crichton [Thu, 25 Jan 2018 18:48:52 +0000 (12:48 -0600)]
Rollup merge of #47600 - varkor:empty-never-array, r=eddyb

Fix type inhabitedness check for arrays

Arrays of uninhabited types were considered to also be uninhabited if
their length had not been evaluated, causing unsoundness.

Fixes #47563.

r? @eddyb

6 years agoRollup merge of #47529 - nikomatsakis:impl-trait-issue-38064, r=cramertj
Alex Crichton [Thu, 25 Jan 2018 18:48:51 +0000 (12:48 -0600)]
Rollup merge of #47529 - nikomatsakis:impl-trait-issue-38064, r=cramertj

track recursion limit when expanding existential impl trait

r? @cramertj