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.
" }
```
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.
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.
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
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
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.
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!
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
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
[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.