about summary refs log tree commit diff
path: root/src/liballoc_jemalloc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-07-02 15:40:26 +0000
committerbors <bors@rust-lang.org>2017-07-02 15:40:26 +0000
commit0679711398bef656699e1ff6b004ecccbdb67284 (patch)
tree80e99dd904fb4c6548d8d6f6dceb95e77c74bdc6 /src/liballoc_jemalloc
parent2a992167c51d30a2b21da7a20d8c3077a2ec0093 (diff)
parent3b91f9406cd4b00ef09d19aca8203ce3539a202d (diff)
downloadrust-0679711398bef656699e1ff6b004ecccbdb67284.tar.gz
rust-0679711398bef656699e1ff6b004ecccbdb67284.zip
Auto merge of #42938 - est31:col_number, r=eddyb
Output column number info when panicking

Outputs the column number when panicking. Useful when you e.g. have code like `foo[i] = bar[k] + bar[l]` and you get a panic with index out of bounds, or when you have an expression like `a = b + c + d + e` and the addition overflows. Now you know which operation to blame!

The format is `file:line:column`, just like for compiler errors. Example output with the patch:

```
thread 'main' panicked at 'index out of bounds: the len is 5 but the index is 8', src/main.rs:3:8
```

As some of the API between the compiler and the library landscape gets broken, this is a bit hackier than I'd originally wanted it to be.

* `panic` and `panic_bounds_check` lang items got an additional column param, on stage0 I still have to use the previous version. After a SNAP this should be resolved.
* For `#[derive(RustcDeserialze)]`, stage0 requires a fixed signature for `std::rt::begin_panic`, so we can't change it right away. What we need to do instead is to keep the signature, and add a `begin_panic_new` function that we use in later stages instead. After a SNAP we can change the `begin_panic` function and rely on it instead of `begin_panic_new`, and one SNAP later we can remove `begin_panic_new`.
* Fortunately I didn't have to break anything about the panic hook API, I could easily extend it.

Note that debuginfo remains unchanged, so RUST_BACKTRACE output won't contain any column info. See issue #42921 for discussion on including the column in debuginfo.
Diffstat (limited to 'src/liballoc_jemalloc')
0 files changed, 0 insertions, 0 deletions