forked from gentoo-utils/gentoo-utils
Merge commit '6eba9cd92c295c5389944f6adda1f1e83b2cb008' as 'subprojects/thiserror'
This commit is contained in:
15
subprojects/thiserror/tests/ui/concat-display.rs
Normal file
15
subprojects/thiserror/tests/ui/concat-display.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use thiserror::Error;
|
||||
|
||||
macro_rules! error_type {
|
||||
($name:ident, $what:expr) => {
|
||||
// Use #[error("invalid {}", $what)] instead.
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
#[error(concat!("invalid ", $what))]
|
||||
pub struct $name;
|
||||
};
|
||||
}
|
||||
|
||||
error_type!(Error, "foo");
|
||||
|
||||
fn main() {}
|
||||
Reference in New Issue
Block a user