rust/src/test
Pietro Albini cc6473d342
Rollup merge of #55970 - RalfJung:miri-backtrace, r=@oli-obk
Miri backtrace improvements

Nicer pretty-printing of the `RUST_CTFE_BACKTRACE`-backtraces:
```
  0: backtrace::backtrace::libunwind::trace::hc410fcb66fe85b11
           at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/backtrace/libunwind.rs:53
     backtrace::backtrace::trace::h2106294a22648407
           at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/backtrace/mod.rs:42
  1: backtrace::capture::Backtrace::new_unresolved::h5d8d98b993d092ba
           at /home/r/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.9/src/capture.rs:88
  2: <rustc::mir::interpret::error::EvalError<'tcx> as core::convert::From<rustc::mir::interpret::error::EvalErrorKind<'tcx, u64>>>::from::h6355269b2a661412
           at librustc/mir/interpret/error.rs:236
  3: <T as core::convert::Into<U>>::into::h70fcb917509539bd
           at /home/r/src/rust/rustc.2/src/libcore/convert.rs:455
  4: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, miri::Evaluator<'tcx>> as miri::fn_call::EvalContextExt<'tcx, 'mir>>::emulate_foreign_item::h9cde0e3ce7455a4a
           at src/fn_call.rs:292
  5: <rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, miri::Evaluator<'tcx>> as miri::fn_call::EvalContextExt<'tcx, 'mir>>::find_fn::h83f89524b9d1a49a
           at src/fn_call.rs:74
  6: <miri::Evaluator<'tcx> as rustc_mir::interpret::machine::Machine<'a, 'mir, 'tcx>>::find_fn::hf9980473c4775f0c
           at src/lib.rs:345
     rustc_mir::interpret::terminator::<impl rustc_mir::interpret::eval_context::EvalContext<'a, 'mir, 'tcx, M>>::eval_fn_call::h401dec4a687f96e9
           at /home/r/src/rust/rustc.2/src/librustc_mir/interpret/terminator.rs:285
```
Indentation is now consistent with `RUST_BACKTRACE`, and the frame number is not repeated when there are multiple symbols for a frame.

Also preserve the `ty::Instance` for the internal backtrace (showing which frames in the user code where on the interpreter stack when the error happened), used by miri to avoid printing spans for libstd internals:
```
error[E0080]: constant evaluation error: the evaluated program panicked
   --> /home/r/src/rust/rustc.2/src/libstd/panicking.rs:525:9
    |
525 |         __rust_start_panic(obj as usize)
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked
    |
    = note: inside call to `std::panicking::rust_panic` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:496:5
    = note: inside call to `std::panicking::rust_panic_with_hook` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:390:5
    = note: inside call to `std::panicking::continue_panic_fmt` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:345:5
note: inside call to `std::rt::begin_panic_fmt` at <::std::macros::panic macros>:8:1
   --> tests/compile-fail/panic.rs:4:5
    |
4   |     assert_eq!(5, 6);
    |     ^^^^^^^^^^^^^^^^^
    = note: inside call to `main` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:74:34
    = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/rt.rs:59:75
    = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/sys_common/backtrace.rs:136:5
    = note: inside call to `std::sys_common::backtrace::__rust_begin_short_backtrace::<[closure@DefId(1/1:1913 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]::{{closure}}[0]) 0:&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:59:13
    = note: inside call to closure at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:310:40
    = note: inside call to `std::panicking::try::do_call::<[closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/panicking.rs:306:5
    = note: inside call to `std::panicking::try::<i32, [closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe]>` at /home/r/src/rust/rustc.2/src/libstd/panic.rs:398:9
    = note: inside call to `std::panic::catch_unwind::<[closure@DefId(1/1:1912 ~ std[78f0]::rt[0]::lang_start_internal[0]::{{closure}}[0]) 0:&&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe], i32>` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:58:25
    = note: inside call to `std::rt::lang_start_internal` at /home/r/src/rust/rustc.2/src/libstd/rt.rs:74:5
    = note: inside call to `std::rt::lang_start::<()>`
```
Also notice that we show filenames and line numbers here now.

r? @oli-obk
2018-11-19 22:06:29 +08:00
..
auxiliary
codegen Remove extern and some return value as an attempt to make the test pass on more platforms 2018-11-14 18:09:54 +01:00
codegen-units More mono items are generated now 2018-10-25 16:47:35 +02:00
compile-fail Auto merge of #54906 - qnighy:fix-issue-50452, r=nikomatsakis 2018-11-15 09:51:53 +00:00
compile-fail-fulldeps Update TypedArena tests 2018-10-19 14:34:44 +02:00
debuginfo Update lldb 2018-11-06 11:46:25 -07:00
incremental Fix tests and assertions; add some comments 2018-10-26 09:50:51 +13:00
incremental-fulldeps Ignore new test on Windows 2018-09-21 10:05:23 -07:00
mir-opt Auto merge of #55716 - RalfJung:escape-to-raw, r=oli-obk 2018-11-15 01:12:01 +00:00
pretty abolish ICE when pretty-printing async block 2018-10-02 23:02:51 -07:00
run-fail Fix two run-fail tests for asmjs 2018-11-04 18:50:57 +01:00
run-fail-fulldeps
run-make Auto merge of #53996 - sekineh:thumb-run, r=japaric 2018-11-06 18:58:31 +00:00
run-make-fulldeps Correct alignment of atomic types and (re)add Atomic{I,U}128 2018-10-27 13:47:11 +03:00
run-pass Rollup merge of #55968 - ehuss:non-mod-rs-tests, r=petrochenkov 2018-11-19 22:06:26 +08:00
run-pass-fulldeps Rollup merge of #55564 - smaeul:test-fixes-2, r=alexcrichton 2018-11-18 23:24:32 +01:00
run-pass-valgrind Remove license headers from unsized-locals tests. 2018-10-24 23:27:17 +09:00
rustdoc Auto merge of #55912 - kennytm:rollup, r=kennytm 2018-11-13 22:17:46 +00:00
rustdoc-js Remove outdated rustdoc PinBox tests 2018-09-18 01:42:27 -07:00
rustdoc-ui properly calculate spans for intra-doc link resolution errors 2018-11-14 18:14:31 -06:00
rustfix
ui Rollup merge of #55970 - RalfJung:miri-backtrace, r=@oli-obk 2018-11-19 22:06:29 +08:00
ui-fulldeps Feature gate extern prelude additions from extern crate items 2018-10-24 00:14:50 +03:00
COMPILER_TESTS.md