From 34662c69614028944668f96c91ef294e7da048f0 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 4 Sep 2019 13:00:14 -0700 Subject: 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 --- src/libstd/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libstd/lib.rs') diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 71050b0dcd1..388c997d7c7 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -452,6 +452,7 @@ pub mod f64; #[macro_use] pub mod thread; pub mod ascii; +pub mod backtrace; pub mod collections; pub mod env; pub mod error; -- cgit 1.4.1-3-g733a5