Closed peter-lyons-kehl closed 1 year ago
That's expected. When mocking a struct with no traits, you must put the #[automock]
over the struct's impl
block, not over the struct
declaration. See https://docs.rs/mockall/latest/mockall/#mocking-structs .
Indeed. Thank you.
Summary:
custom attribute panicked
fromautomock
for a trivial (no fields, no trait)struct
. Please help.Using
1.74.0-nightly (2f5df8a94 2023-08-31)
. The same with the most recent (today's)1.74.0-nightly (ec08a0337 2023-09-04)
, and with current stablev1.72.0
(after changingCargo.toml
not to usenightly
feature).Minimized source code: https://github.com/peter-kehl/mockall_enum_demo.
Cargo.toml
= https://github.com/peter-kehl/mockall_enum_demo/blob/main/Cargo.toml:src/lib.rs
= https://github.com/peter-kehl/mockall_enum_demo/blob/main/src/lib.rs:src/manu_mock.rs
= https://github.com/peter-kehl/mockall_enum_demo/blob/main/src/manu_mock.rs: