mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
5e9b8cd4b2
Summary: Release notes: - https://github.com/dtolnay/thiserror/releases/tag/1.0.24 - https://github.com/dtolnay/thiserror/releases/tag/1.0.25 - https://github.com/dtolnay/thiserror/releases/tag/1.0.26 - https://github.com/dtolnay/thiserror/releases/tag/1.0.27 - https://github.com/dtolnay/thiserror/releases/tag/1.0.28 - https://github.com/dtolnay/thiserror/releases/tag/1.0.29 The pertinent feature is 1.0.29 adding support for inferred trait bounds on error types that contain generic type parameters. I remember someone asking for this in fbcode but I forget what project it was for. ``` use thiserror::Error; #[derive(Error, Debug)] pub enum MyError<E, F, G> { #[error("thing {0} ({0:?})")] Variant(E), #[error("some error")] Delegate(#[source] SomeError<F>), #[error("err 0o{val:o}")] Octal { val: G }, } ``` ``` // generated impl<E, F, G> std::error::Error for MyError<E, F, G> where SomeError<F>: std::error::Error + 'static, //' Self: std::fmt::Debug + std::fmt::Display; impl<E, F, G> std::fmt::Display for MyError<E, F, G> where E: std::fmt::Debug + std::fmt::Display, G: std::fmt::Octal; ``` Reviewed By: zertosh Differential Revision: D30758449 fbshipit-source-id: b3afe08fe8c8affa26693df9cbb63e04632ea1d3 |
||
---|---|---|
.. | ||
src | ||
test_repo_factory | ||
Cargo.toml |