22 Commits

Author SHA1 Message Date
David Tolnay
db75b6a91f
Add quotes around filename in Backtrace debug 2020-03-09 12:01:31 -07:00
David Tolnay
3ba89e8750
Remove quotes around unknown fn placeholder in backtrace 2020-03-09 12:01:31 -07:00
Matthias Krüger
9523c89f18 use is_empty() instead of len() == x to determine if structs are empty. 2020-02-28 15:16:27 +01:00
Jane Lusby
ec8ee7fb81 remove intentionally failing test 2020-02-11 08:39:27 -08:00
Jane Lusby
c8817aa521 backwards again, god damnit 2020-02-10 21:54:27 -08:00
Jane Lusby
6797bfd203 rule over the code in libstd with an iron fist 2020-02-10 21:38:59 -08:00
Jane Lusby
7064a0ec59 maximum alternative consistency! 2020-02-10 21:07:36 -08:00
Jane Lusby
192b103917 make symbol printing consistent with backtrace_rs 2020-02-10 17:45:58 -08:00
Jane Lusby
de25048a23 add nice alt fmt for debug 2020-02-10 17:42:04 -08:00
Jane Lusby
230ed3ea75 use debug_map and skip empty frames 2020-02-10 17:28:04 -08:00
Jane Lusby
70c9133014 remove Some from fn name 2020-02-10 15:48:09 -08:00
Jane Lusby
87117783fb final format cleanups 2020-02-10 15:39:32 -08:00
Jane Lusby
583dd2c3ee make it compile 2020-02-10 15:18:29 -08:00
Jane Lusby
76e6d6fe11 remove unnecessary Debug impl for BacktraceFrame 2020-02-10 15:17:40 -08:00
Jane Lusby
0d5444ffa6 remove unnecessary derives 2020-02-10 15:16:24 -08:00
Jane Lusby
c0ba79eefd less noisy format 2020-02-10 15:15:13 -08:00
Jane Lusby
49204563e1 Get vaguely working with a test for checking output 2020-02-10 14:28:32 -08:00
Jane Lusby
b637c0e84a Add initial debug fmt for Backtrace 2020-02-10 14:28:31 -08:00
David Tolnay
4436c9d354
Format libstd with rustfmt
This commit applies rustfmt with rust-lang/rust's default settings to
files in src/libstd *that are not involved in any currently open PR* to
minimize merge conflicts. THe list of files involved in open PRs was
determined by querying GitHub's GraphQL API with this script:
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8

With the list of files from the script in outstanding_files, the
relevant commands were:

    $ find src/libstd -name '*.rs' \
        | xargs rustfmt --edition=2018 --unstable-features --skip-children
    $ rg libstd outstanding_files | xargs git checkout --

Repeating this process several months apart should get us coverage of
most of the rest of libstd.

To confirm no funny business:

    $ git checkout $THIS_COMMIT^
    $ git show --pretty= --name-only $THIS_COMMIT \
        | xargs rustfmt --edition=2018 --unstable-features --skip-children
    $ git diff $THIS_COMMIT  # there should be no difference
2019-11-29 18:43:27 -08:00
Ben Boeckel
fb80e6c62e BacktraceStatus: add Eq impl
See discussion on #53487.
2019-10-02 08:17:28 -04:00
Ralf Jung
dac0a158eb rename the crate, not the feature 2019-09-14 12:12:32 +02:00
Alex Crichton
34662c6961 std: Add a backtrace module
This commit adds a `backtrace` module to the standard library, as
designed in [RFC 2504]. The `Backtrace` type is intentionally very
conservative, effectively only allowing capturing it and printing it.

Additionally this commit also adds a `backtrace` method to the `Error`
trait which defaults to returning `None`, as specified in [RFC 2504].
More information about the design here can be found in [RFC 2504] and in
the [tracking issue].

Implementation-wise this is all based on the `backtrace` crate and very
closely mirrors the `backtrace::Backtrace` type on crates.io. Otherwise
it's pretty standard in how it handles everything internally.

[RFC 2504]: https://github.com/rust-lang/rfcs/blob/master/text/2504-fix-error.md
[tracking issue]: https://github.com/rust-lang/rust/issues/53487

cc #53487
2019-09-09 08:20:34 -07:00