Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: unblock
Please unblock package rust-failure rust-failure-derive was mistakenly uploaded a few weeks ago and has now migrated to testing. It is not compatible with rust-failure 0.1.3-1 which is currently in testing, and causes FTBFS of other packages e.g #924206. Robin and kpcyrd, please confirm that this fixes the problem. unblock rust-failure/0.1.5-1 -- System Information: Debian Release: buster/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'stable'), (300, 'unstable'), (100, 'experimental'), (1, 'experimental-debug') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.19.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled
diff -Nru rust-failure-0.1.3/book/src/error-errorkind.md rust-failure-0.1.5/book/src/error-errorkind.md --- rust-failure-0.1.3/book/src/error-errorkind.md 2018-07-27 11:18:03.000000000 -0700 +++ rust-failure-0.1.5/book/src/error-errorkind.md 2018-12-29 15:13:10.000000000 -0800 @@ -39,6 +39,10 @@ ```rust impl Fail for MyError { + fn name(&self) -> Option<&str> { + self.inner.name() + } + fn cause(&self) -> Option<&Fail> { self.inner.cause() } @@ -140,4 +144,4 @@ [use-error]: ./use-error.html [custom-fail]: ./custom-fail.html -[context-api]: https://boats.gitlab.io/failure/doc/failure/struct.Context.html +[context-api]: https://docs.rs/failure/latest/failure/struct.Context.html diff -Nru rust-failure-0.1.3/book/src/error-msg.md rust-failure-0.1.5/book/src/error-msg.md --- rust-failure-0.1.3/book/src/error-msg.md 2018-07-26 14:32:49.000000000 -0700 +++ rust-failure-0.1.5/book/src/error-msg.md 2018-12-29 15:00:15.000000000 -0800 @@ -55,5 +55,5 @@ [custom-fail]: ./custom-fail.html [use-error]: ./use-error.html -[err-msg-api]: https://boats.gitlab.io/failure/doc/failure/fn.err_msg.html -[format-err-api]: https://boats.gitlab.io/failure/doc/failure/macro.format_err.html +[err-msg-api]: https://docs.rs/failure/latest/failure/fn.err_msg.html +[format-err-api]: https://docs.rs/failure/latest/failure/macro.format_err.html diff -Nru rust-failure-0.1.3/book/src/fail.md rust-failure-0.1.5/book/src/fail.md --- rust-failure-0.1.3/book/src/fail.md 2018-10-20 12:05:53.000000000 -0700 +++ rust-failure-0.1.5/book/src/fail.md 2018-12-29 14:59:06.000000000 -0800 @@ -147,6 +147,6 @@ implement `std::error::Error` and also override the backtrace and cause methods on `Fail`. We intend to enable this with specialization when it becomes stable. -[derive-docs]: https://boats.gitlab.io/failure/derive-fail.html +[derive-docs]: ./derive-fail.html [stderror]: https://doc.rust-lang.org/std/error/trait.Error.html [backtrace-crate]: http://alexcrichton.com/backtrace-rs diff -Nru rust-failure-0.1.3/book/src/intro.md rust-failure-0.1.5/book/src/intro.md --- rust-failure-0.1.3/book/src/intro.md 2018-07-27 11:09:57.000000000 -0700 +++ rust-failure-0.1.5/book/src/intro.md 2018-12-29 14:58:24.000000000 -0800 @@ -6,7 +6,7 @@ * [API documentation][api] * [failure source code][repo] -[api]: https://boats.gitlab.io/failure/doc/failure +[api]: https://docs.rs/failure [repo]: https://github.com/rust-lang-nursery/failure ```rust diff -Nru rust-failure-0.1.3/book/src/string-custom-error.md rust-failure-0.1.5/book/src/string-custom-error.md --- rust-failure-0.1.3/book/src/string-custom-error.md 2018-10-20 12:05:53.000000000 -0700 +++ rust-failure-0.1.5/book/src/string-custom-error.md 2018-12-29 15:13:39.000000000 -0800 @@ -20,6 +20,10 @@ } impl Fail for MyError { + fn name(&self) -> Option<&str> { + self.inner.name() + } + fn cause(&self) -> Option<&Fail> { self.inner.cause() } @@ -105,6 +109,10 @@ } impl Fail for MyError { + fn name(&self) -> Option<&str> { + self.inner.name() + } + fn cause(&self) -> Option<&Fail> { self.inner.cause() } diff -Nru rust-failure-0.1.3/Cargo.lock.ci rust-failure-0.1.5/Cargo.lock.ci --- rust-failure-0.1.3/Cargo.lock.ci 1969-12-31 16:00:00.000000000 -0800 +++ rust-failure-0.1.5/Cargo.lock.ci 2018-12-29 12:51:09.000000000 -0800 @@ -0,0 +1,136 @@ +[[package]] +name = "backtrace" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "backtrace-sys" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cc" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "failure" +version = "0.1.4" +dependencies = [ + "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.4", +] + +[[package]] +name = "failure_derive" +version = "0.1.4" +dependencies = [ + "failure 0.1.4", + "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libc" +version = "0.2.43" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro2" +version = "0.4.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "syn" +version = "0.15.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "synstructure" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" +"checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0" +"checksum cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4a8b715cb4597106ea87c7c84b2f1d452c7492033765df7f32651e66fcf749" +"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" +"checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" +"checksum proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)" = "77619697826f31a02ae974457af0b29b723e5619e113e9397b8b82c6bd253f09" +"checksum quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "53fa22a1994bd0f9372d7a816207d8a2677ad0325b073f5c5332760f0fb62b5c" +"checksum rustc-demangle 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "01b90379b8664dd83460d59bdc5dd1fd3172b8913788db483ed1325171eab2f7" +"checksum syn 0.15.23 (registry+https://github.com/rust-lang/crates.io-index)" = "9545a6a093a3f0bd59adb472700acc08cad3776f860f16a897dfce8c88721cbc" +"checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" +"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff -Nru rust-failure-0.1.3/Cargo.toml rust-failure-0.1.5/Cargo.toml --- rust-failure-0.1.3/Cargo.toml 1969-12-31 16:00:00.000000000 -0800 +++ rust-failure-0.1.5/Cargo.toml 1969-12-31 16:00:00.000000000 -0800 @@ -12,10 +12,10 @@ [package] name = "failure" -version = "0.1.3" +version = "0.1.5" authors = ["Without Boats <bo...@mozilla.com>"] description = "Experimental error handling abstraction." -homepage = "https://boats.gitlab.io/failure" +homepage = "https://rust-lang-nursery.github.io/failure/" documentation = "https://docs.rs/failure" license = "MIT OR Apache-2.0" repository = "https://github.com/rust-lang-nursery/failure" @@ -24,7 +24,7 @@ optional = true [dependencies.failure_derive] -version = "0.1.3" +version = "0.1.5" optional = true [features] diff -Nru rust-failure-0.1.3/Cargo.toml.orig rust-failure-0.1.5/Cargo.toml.orig --- rust-failure-0.1.3/Cargo.toml.orig 2018-10-20 12:09:05.000000000 -0700 +++ rust-failure-0.1.5/Cargo.toml.orig 2019-01-02 01:39:26.000000000 -0800 @@ -2,15 +2,15 @@ authors = ["Without Boats <bo...@mozilla.com>"] description = "Experimental error handling abstraction." documentation = "https://docs.rs/failure" -homepage = "https://boats.gitlab.io/failure" +homepage = "https://rust-lang-nursery.github.io/failure/" license = "MIT OR Apache-2.0" name = "failure" repository = "https://github.com/rust-lang-nursery/failure" -version = "0.1.3" +version = "0.1.5" [dependencies.failure_derive] optional = true -version = "0.1.3" +version = "0.1.5" path = "./failure_derive" [dependencies.backtrace] diff -Nru rust-failure-0.1.3/.cargo_vcs_info.json rust-failure-0.1.5/.cargo_vcs_info.json --- rust-failure-0.1.3/.cargo_vcs_info.json 1969-12-31 16:00:00.000000000 -0800 +++ rust-failure-0.1.5/.cargo_vcs_info.json 1969-12-31 16:00:00.000000000 -0800 @@ -0,0 +1,5 @@ +{ + "git": { + "sha1": "65c825aeaa6b07a51e4fb1d824625485061604f4" + } +} diff -Nru rust-failure-0.1.3/debian/cargo-checksum.json rust-failure-0.1.5/debian/cargo-checksum.json --- rust-failure-0.1.3/debian/cargo-checksum.json 2018-11-14 20:34:34.000000000 -0800 +++ rust-failure-0.1.5/debian/cargo-checksum.json 2019-03-16 14:27:28.000000000 -0700 @@ -1 +1 @@ -{"package":"6dd377bcc1b1b7ce911967e3ec24fa19c3224394ec05b54aa7b083d498341ac7","files":{}} +{"package":"795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2","files":{}} diff -Nru rust-failure-0.1.3/debian/changelog rust-failure-0.1.5/debian/changelog --- rust-failure-0.1.3/debian/changelog 2018-11-14 20:34:34.000000000 -0800 +++ rust-failure-0.1.5/debian/changelog 2019-03-16 14:27:28.000000000 -0700 @@ -1,3 +1,9 @@ +rust-failure (0.1.5-1) unstable; urgency=medium + + * Package failure 0.1.5 from crates.io using debcargo 2.2.10 + + -- Robin Krahl <robin.kr...@ireas.org> Sat, 16 Mar 2019 14:27:28 -0700 + rust-failure (0.1.3-1) unstable; urgency=medium * Package failure 0.1.3 from crates.io using debcargo 2.2.9 diff -Nru rust-failure-0.1.3/debian/control rust-failure-0.1.5/debian/control --- rust-failure-0.1.3/debian/control 2018-11-14 20:34:34.000000000 -0800 +++ rust-failure-0.1.5/debian/control 2019-03-16 14:27:28.000000000 -0700 @@ -2,19 +2,20 @@ Section: rust Priority: optional Build-Depends: debhelper (>= 11), - dh-cargo (>= 10), + dh-cargo (>= 15), cargo:native <!nocheck>, rustc:native <!nocheck>, libstd-rust-dev <!nocheck>, librust-backtrace-0.3+default-dev (>= 0.3.3-~~) <!nocheck>, - librust-failure-derive-0.1+default-dev (>= 0.1.3-~~) <!nocheck> + librust-failure-derive-0.1+default-dev (>= 0.1.5-~~) <!nocheck> Maintainer: Debian Rust Maintainers <pkg-rust-maintain...@alioth-lists.debian.net> Uploaders: - Ximin Luo <infini...@debian.org> + Ximin Luo <infini...@debian.org>, + Robin Krahl <robin.kr...@ireas.org> Standards-Version: 4.2.0 Vcs-Git: https://salsa.debian.org/rust-team/debcargo-conf.git [src/failure] Vcs-Browser: https://salsa.debian.org/rust-team/debcargo-conf/tree/master/src/failure -Homepage: https://boats.gitlab.io/failure +Homepage: https://rust-lang-nursery.github.io/failure/ Package: librust-failure-dev Architecture: any @@ -31,7 +32,7 @@ Provides: librust-failure-0-dev (= ${binary:Version}), librust-failure-0.1-dev (= ${binary:Version}), - librust-failure-0.1.3-dev (= ${binary:Version}) + librust-failure-0.1.5-dev (= ${binary:Version}) Description: Experimental error handling abstraction - Rust source code This package contains the source for the Rust failure crate, packaged by debcargo for use with cargo and dh-cargo. @@ -46,7 +47,7 @@ Provides: librust-failure-0+backtrace-dev (= ${binary:Version}), librust-failure-0.1+backtrace-dev (= ${binary:Version}), - librust-failure-0.1.3+backtrace-dev (= ${binary:Version}) + librust-failure-0.1.5+backtrace-dev (= ${binary:Version}) Description: Experimental error handling abstraction - feature "backtrace" This metapackage enables feature backtrace for the Rust failure crate, by pulling in any additional dependencies needed by that feature. @@ -62,7 +63,7 @@ Provides: librust-failure-0+default-dev (= ${binary:Version}), librust-failure-0.1+default-dev (= ${binary:Version}), - librust-failure-0.1.3+default-dev (= ${binary:Version}) + librust-failure-0.1.5+default-dev (= ${binary:Version}) Description: Experimental error handling abstraction - feature "default" This metapackage enables feature default for the Rust failure crate, by pulling in any additional dependencies needed by that feature. @@ -73,11 +74,11 @@ Depends: ${misc:Depends}, librust-failure-dev (= ${binary:Version}), - librust-failure-derive-0.1+default-dev (>= 0.1.3-~~) + librust-failure-derive-0.1+default-dev (>= 0.1.5-~~) Provides: librust-failure-0+derive-dev (= ${binary:Version}), librust-failure-0.1+derive-dev (= ${binary:Version}), - librust-failure-0.1.3+derive-dev (= ${binary:Version}) + librust-failure-0.1.5+derive-dev (= ${binary:Version}) Description: Experimental error handling abstraction - feature "derive" This metapackage enables feature derive for the Rust failure crate, by pulling in any additional dependencies needed by that feature. @@ -88,11 +89,11 @@ Depends: ${misc:Depends}, librust-failure-dev (= ${binary:Version}), - librust-failure-derive-0.1+default-dev (>= 0.1.3-~~) + librust-failure-derive-0.1+default-dev (>= 0.1.5-~~) Provides: librust-failure-0+failure-derive-dev (= ${binary:Version}), librust-failure-0.1+failure-derive-dev (= ${binary:Version}), - librust-failure-0.1.3+failure-derive-dev (= ${binary:Version}) + librust-failure-0.1.5+failure-derive-dev (= ${binary:Version}) Description: Experimental error handling abstraction - feature "failure_derive" This metapackage enables feature failure_derive for the Rust failure crate, by pulling in any additional dependencies needed by that feature. @@ -107,7 +108,7 @@ Provides: librust-failure-0+std-dev (= ${binary:Version}), librust-failure-0.1+std-dev (= ${binary:Version}), - librust-failure-0.1.3+std-dev (= ${binary:Version}) + librust-failure-0.1.5+std-dev (= ${binary:Version}) Description: Experimental error handling abstraction - feature "std" This metapackage enables feature std for the Rust failure crate, by pulling in any additional dependencies needed by that feature. diff -Nru rust-failure-0.1.3/debian/copyright rust-failure-0.1.5/debian/copyright --- rust-failure-0.1.3/debian/copyright 2018-11-14 20:34:34.000000000 -0800 +++ rust-failure-0.1.5/debian/copyright 2019-03-16 14:27:28.000000000 -0700 @@ -4,13 +4,14 @@ Source: https://github.com/rust-lang-nursery/failure Files: * -Copyright: 2017-2018 Without Boats <bo...@mozilla.com> +Copyright: 2017-2019 Without Boats <bo...@mozilla.com> License: MIT or Apache-2.0 Files: debian/* Copyright: - 2018 Debian Rust Maintainers <pkg-rust-maintain...@alioth-lists.debian.net> - 2018 Ximin Luo <infini...@debian.org> + 2018-2019 Debian Rust Maintainers <pkg-rust-maintain...@alioth-lists.debian.net> + 2018-2019 Ximin Luo <infini...@debian.org> + 2018-2019 Robin Krahl <robin.kr...@ireas.org> License: MIT or Apache-2.0 License: Apache-2.0 diff -Nru rust-failure-0.1.3/debian/copyright.debcargo.hint rust-failure-0.1.5/debian/copyright.debcargo.hint --- rust-failure-0.1.3/debian/copyright.debcargo.hint 2018-11-14 20:34:34.000000000 -0800 +++ rust-failure-0.1.5/debian/copyright.debcargo.hint 2019-03-16 14:27:28.000000000 -0700 @@ -14,8 +14,9 @@ Files: debian/* Copyright: - 2018 Debian Rust Maintainers <pkg-rust-maintain...@alioth-lists.debian.net> - 2018 Ximin Luo <infini...@debian.org> + 2018-2019 Debian Rust Maintainers <pkg-rust-maintain...@alioth-lists.debian.net> + 2018-2019 Ximin Luo <infini...@debian.org> + 2018-2019 Robin Krahl <robin.kr...@ireas.org> License: MIT or Apache-2.0 License: Apache-2.0 diff -Nru rust-failure-0.1.3/debian/debcargo.toml rust-failure-0.1.5/debian/debcargo.toml --- rust-failure-0.1.3/debian/debcargo.toml 2018-11-14 20:34:34.000000000 -0800 +++ rust-failure-0.1.5/debian/debcargo.toml 2019-03-16 14:27:28.000000000 -0700 @@ -1,2 +1,2 @@ overlay = "." -uploaders = ["Ximin Luo <infini...@debian.org>"] +uploaders = ["Ximin Luo <infini...@debian.org>", "Robin Krahl <robin.kr...@ireas.org>"] diff -Nru rust-failure-0.1.3/examples/simple.rs rust-failure-0.1.5/examples/simple.rs --- rust-failure-0.1.3/examples/simple.rs 2018-08-01 04:46:45.000000000 -0700 +++ rust-failure-0.1.5/examples/simple.rs 2018-12-29 14:57:56.000000000 -0800 @@ -16,7 +16,7 @@ } fn main() { - for cause in Fail::iter_causes(&bad_function().unwrap_err()) { - println!("{}", cause); + for cause in Fail::iter_chain(&bad_function().unwrap_err()) { + println!("{}: {}", cause.name().unwrap_or("Error"), cause); } } diff -Nru rust-failure-0.1.3/RELEASES.md rust-failure-0.1.5/RELEASES.md --- rust-failure-0.1.3/RELEASES.md 2018-10-20 12:10:28.000000000 -0700 +++ rust-failure-0.1.5/RELEASES.md 2019-01-02 01:41:01.000000000 -0800 @@ -1,3 +1,16 @@ +# Version 0.1.5 + +- Resolve a regression with error conversions (#290) +- Added `name()` to `Fail` and `Error` + +# Version 0.1.4 + +- Improved error reporting of the derive feature +- Resolved a potential internal ambiguity when using the backtrace feature + that prevented backtrace from improving an upstream API. +- Changed the bounds on std error compat conversions through the From trait + to take Sync and Send into account. + # Version 0.1.3 - Added `Context::map` diff -Nru rust-failure-0.1.3/src/backtrace/mod.rs rust-failure-0.1.5/src/backtrace/mod.rs --- rust-failure-0.1.3/src/backtrace/mod.rs 2018-08-01 04:46:45.000000000 -0700 +++ rust-failure-0.1.5/src/backtrace/mod.rs 2018-12-28 13:14:14.000000000 -0800 @@ -129,7 +129,7 @@ impl Debug for Backtrace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if let Some(bt) = self.internal.as_backtrace() { - bt.fmt(f) + Debug::fmt(bt, f) } else { Ok(()) } } } @@ -137,7 +137,7 @@ impl Display for Backtrace { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if let Some(bt) = self.internal.as_backtrace() { - bt.fmt(f) + Debug::fmt(bt, f) } else { Ok(()) } } } diff -Nru rust-failure-0.1.3/src/compat.rs rust-failure-0.1.5/src/compat.rs --- rust-failure-0.1.3/src/compat.rs 2018-07-27 11:09:57.000000000 -0700 +++ rust-failure-0.1.5/src/compat.rs 2019-01-02 01:37:18.000000000 -0800 @@ -44,4 +44,10 @@ Box::new(Compat { error }) } } + + impl From<Error> for Box<StdError + Send + Sync> { + fn from(error: Error) -> Box<StdError + Send + Sync> { + Box::new(Compat { error }) + } + } } diff -Nru rust-failure-0.1.3/src/context.rs rust-failure-0.1.5/src/context.rs --- rust-failure-0.1.3/src/context.rs 2018-10-20 12:05:53.000000000 -0700 +++ rust-failure-0.1.5/src/context.rs 2018-12-29 14:57:56.000000000 -0800 @@ -108,6 +108,10 @@ } impl<D: Display + Send + Sync + 'static> Fail for Context<D> { + fn name(&self) -> Option<&str> { + self.failure.as_cause().and_then(|x| x.name()) + } + fn cause(&self) -> Option<&Fail> { self.failure.as_cause() } diff -Nru rust-failure-0.1.3/src/error/mod.rs rust-failure-0.1.5/src/error/mod.rs --- rust-failure-0.1.3/src/error/mod.rs 2018-10-20 12:05:53.000000000 -0700 +++ rust-failure-0.1.5/src/error/mod.rs 2018-12-29 14:57:56.000000000 -0800 @@ -70,6 +70,11 @@ self.imp.failure() } + /// Returns the name of the underlying fail. + pub fn name(&self) -> Option<&str> { + self.as_fail().name() + } + /// Returns a reference to the underlying cause of this `Error`. Unlike the /// method on `Fail`, this does not return an `Option`. The `Error` type /// always has an underlying failure. diff -Nru rust-failure-0.1.3/src/error_message.rs rust-failure-0.1.5/src/error_message.rs --- rust-failure-0.1.3/src/error_message.rs 2018-07-27 11:09:57.000000000 -0700 +++ rust-failure-0.1.5/src/error_message.rs 2018-12-29 14:57:56.000000000 -0800 @@ -19,7 +19,11 @@ msg: D, } -impl<D: Display + Debug + Sync + Send + 'static> Fail for ErrorMessage<D> { } +impl<D: Display + Debug + Sync + Send + 'static> Fail for ErrorMessage<D> { + fn name(&self) -> Option<&str> { + Some("failure::ErrorMessage") + } +} impl<D: Display + Debug + Sync + Send + 'static> Display for ErrorMessage<D> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff -Nru rust-failure-0.1.3/src/lib.rs rust-failure-0.1.5/src/lib.rs --- rust-failure-0.1.3/src/lib.rs 2018-09-29 12:23:03.000000000 -0700 +++ rust-failure-0.1.5/src/lib.rs 2018-12-29 14:57:56.000000000 -0800 @@ -23,10 +23,7 @@ #![cfg_attr(not(feature = "std"), no_std)] #![deny(missing_docs)] #![deny(warnings)] -#![cfg_attr( - feature = "small-error", - feature(extern_types, allocator_api) -)] +#![cfg_attr(feature = "small-error", feature(extern_types, allocator_api))] macro_rules! with_std { ($($i:item)*) => ($(#[cfg(feature = "std")]$i)*) } macro_rules! without_std { ($($i:item)*) => ($(#[cfg(not(feature = "std"))]$i)*) } @@ -109,6 +106,16 @@ /// `std::error::Error`, and are also `Send`, `Sync`, and `'static`, implement /// `Fail` by a blanket impl. pub trait Fail: Display + Debug + Send + Sync + 'static { + /// Returns the "name" of the error. + /// + /// This is typically the type name. Not all errors will implement + /// this. This method is expected to be most useful in situations + /// where errors need to be reported to external instrumentation systems + /// such as crash reporters. + fn name(&self) -> Option<&str> { + None + } + /// Returns a reference to the underlying cause of this failure, if it /// is an error that wraps other errors. /// @@ -166,10 +173,7 @@ } #[doc(hidden)] - #[deprecated( - since = "0.1.2", - note = "please use the 'iter_chain()' method instead" - )] + #[deprecated(since = "0.1.2", note = "please use the 'iter_chain()' method instead")] fn causes(&self) -> Causes where Self: Sized, @@ -259,10 +263,7 @@ } /// Deprecated alias to `iter_chain`. - #[deprecated( - since = "0.1.2", - note = "please use the 'iter_chain()' method instead" - )] + #[deprecated(since = "0.1.2", note = "please use the 'iter_chain()' method instead")] pub fn causes(&self) -> Causes { Causes { fail: Some(self) } } diff -Nru rust-failure-0.1.3/src/macros.rs rust-failure-0.1.5/src/macros.rs --- rust-failure-0.1.3/src/macros.rs 2018-09-29 12:22:26.000000000 -0700 +++ rust-failure-0.1.5/src/macros.rs 2018-12-28 13:15:15.000000000 -0800 @@ -11,8 +11,8 @@ ($e:expr) => { return Err($crate::err_msg($e)); }; - ($fmt:expr, $($arg:tt)+) => { - return Err($crate::err_msg(format!($fmt, $($arg)+))); + ($fmt:expr, $($arg:tt)*) => { + return Err($crate::err_msg(format!($fmt, $($arg)*))); }; } @@ -28,9 +28,9 @@ bail!($e); } }; - ($cond:expr, $fmt:expr, $($arg:tt)+) => { + ($cond:expr, $fmt:expr, $($arg:tt)*) => { if !($cond) { - bail!($fmt, $($arg)+); + bail!($fmt, $($arg)*); } }; } diff -Nru rust-failure-0.1.3/tests/basic_fail.rs rust-failure-0.1.5/tests/basic_fail.rs --- rust-failure-0.1.3/tests/basic_fail.rs 1969-12-31 16:00:00.000000000 -0800 +++ rust-failure-0.1.5/tests/basic_fail.rs 2018-12-29 14:57:56.000000000 -0800 @@ -0,0 +1,21 @@ +#[macro_use] +extern crate failure; + +use failure::Fail; + +#[test] +fn test_name() { + #[derive(Fail, Debug)] + #[fail(display = "my error")] + struct MyError; + + let err = MyError; + + assert_eq!(err.to_string(), "my error"); + assert_eq!(err.name(), Some("basic_fail::MyError")); + + let ctx = err.context("whatever"); + + assert_eq!(ctx.to_string(), "whatever"); + assert_eq!(ctx.name(), Some("basic_fail::MyError")); +} \ No newline at end of file diff -Nru rust-failure-0.1.3/tests/fail_compat.rs rust-failure-0.1.5/tests/fail_compat.rs --- rust-failure-0.1.3/tests/fail_compat.rs 1969-12-31 16:00:00.000000000 -0800 +++ rust-failure-0.1.5/tests/fail_compat.rs 2019-01-02 01:37:18.000000000 -0800 @@ -0,0 +1,35 @@ +#[macro_use] +extern crate failure; + +use failure::Fail; + +fn return_failure() -> Result<(), failure::Error> { + #[derive(Fail, Debug)] + #[fail(display = "my error")] + struct MyError; + + let err = MyError; + Err(err.into()) +} + +fn return_error() -> Result<(), Box<std::error::Error>> { + return_failure()?; + Ok(()) +} + +fn return_error_send_sync() -> Result<(), Box<std::error::Error + Send + Sync>> { + return_failure()?; + Ok(()) +} + +#[test] +fn smoke_default_compat() { + let err = return_error(); + assert!(err.is_err()); +} + +#[test] +fn smoke_compat_send_sync() { + let err = return_error_send_sync(); + assert!(err.is_err()); +} diff -Nru rust-failure-0.1.3/tests/macro_trailing_comma.rs rust-failure-0.1.5/tests/macro_trailing_comma.rs --- rust-failure-0.1.3/tests/macro_trailing_comma.rs 1969-12-31 16:00:00.000000000 -0800 +++ rust-failure-0.1.5/tests/macro_trailing_comma.rs 2018-12-29 14:56:59.000000000 -0800 @@ -0,0 +1,54 @@ +#[macro_use] +extern crate failure; + +// NOTE: +// +// This test is in a separate file due to the fact that ensure! cannot be used +// from within failure. +// +// (you get: 'macro-expanded `macro_export` macros from the current crate cannot +// be referred to by absolute paths') + +// Encloses an early-returning macro in an IIFE so that we +// can treat it as a Result-returning function. +macro_rules! wrap_early_return { + ($expr:expr) => {{ + fn func() -> Result<(), failure::Error> { + let _ = $expr; + + #[allow(unreachable_code)] + Ok(()) + } + func().map_err(|e| e.to_string()) + }}; +} + +#[test] +fn bail() { + assert_eq!( + wrap_early_return!(bail!("test")), + wrap_early_return!(bail!("test",))); + assert_eq!( + wrap_early_return!(bail!("test {}", 4)), + wrap_early_return!(bail!("test {}", 4,))); +} + +#[test] +fn ensure() { + assert_eq!( + wrap_early_return!(ensure!(false, "test")), + wrap_early_return!(ensure!(false, "test",))); + assert_eq!( + wrap_early_return!(ensure!(false, "test {}", 4)), + wrap_early_return!(ensure!(false, "test {}", 4,))); +} + +#[test] +fn format_err() { + assert_eq!( + format_err!("test").to_string(), + format_err!("test",).to_string()); + assert_eq!( + format_err!("test {}", 4).to_string(), + format_err!("test {}", 4,).to_string()); +} diff -Nru rust-failure-0.1.3/.travis.yml rust-failure-0.1.5/.travis.yml --- rust-failure-0.1.3/.travis.yml 2018-07-27 11:09:57.000000000 -0700 +++ rust-failure-0.1.5/.travis.yml 2018-12-29 12:50:00.000000000 -0800 @@ -6,6 +6,7 @@ - nightly cache: cargo script: + - if [ "$TRAVIS_RUST_VERSION" == "1.18.0" ]; then cp Cargo.lock.ci Cargo.lock; fi - cargo test - cargo test --features backtrace - cargo check --no-default-features