Skip to content

Commit

Permalink
test(from): add an enum for transparent variants
Browse files Browse the repository at this point in the history
  • Loading branch information
onkoe committed Aug 21, 2024
1 parent e304f68 commit 4a7a171
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion macros/tests/from.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use macros::Error;
use std::error::Error;
use std::{error::Error, num::ParseIntError, str::ParseBoolError};

// This one only has one attr, so it works fine.
#[derive(Debug, Error)]
Expand All @@ -24,3 +24,14 @@ fn t() {

// TODO: try formatting the error
}

#[derive(Debug, Error)]
enum Transparent {
#[error(transparent)]
Structlike {
#[from]
err_is_from: ParseIntError,
},
#[error(transparent)]
Tuplelike(#[from] ParseBoolError),
}

0 comments on commit 4a7a171

Please sign in to comment.