Skip to content

Commit ffa1cb3

Browse files
committed
Fix a non-working (and non-failing) test
My changes have broken a test, which actually was actually incorrect twice: it wasn't doing the right thing (forwarding the From impl to the field type), but it wasn't testing the right thing either so it succeeded. Make the test actually check that from forwarding works, and make the forwarding actually work.
1 parent b32095b commit ffa1cb3

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/lib.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,17 @@ struct Unit;
169169
// containing `$crate`
170170
macro_rules! use_dollar_crate {
171171
() => {
172-
struct Foo;
173-
#[derive(From)]
172+
#[derive(From, Debug, PartialEq)]
173+
struct Foo(u32);
174+
#[derive(From, Debug, PartialEq)]
174175
enum Bar {
175-
First(#[from(forward)] $crate::Foo),
176+
#[from(forward)]
177+
First($crate::Foo),
178+
}
179+
180+
#[test]
181+
fn test_dollar_crate() {
182+
assert_eq!(Bar::First(Foo(123)), 123.into());
176183
}
177184
};
178185
}

0 commit comments

Comments
 (0)