The __serialize_key macro currently emits Result<S::Ok, S::Error> as the return type of the functions, which can break the macro code if Result is redefined (e.g. type Result<T> = ... which is pretty common)
This occurred to me while I was building zbus (2.0.0-beta.7) and already had slotmap with the serde feature enabled inside my crate, which lead to this error:
error[E0107]: this type alias takes 1 generic argument but 2 generic arguments were supplied
--> /home/stu/.cargo/registry/src/github.com-1ecc6299db9ec823/zbus-2.0.0-beta.7/src/proxy.rs:51:1
|
51 | / new_key_type! {
52 | | /// The ID for a registered proprety changed handler.
53 | | pub struct PropertyChangedHandlerId;
54 | | }
| | ^
| | |
| |_expected 1 generic argument
| help: remove this generic argument
|
note: type alias defined here, with 1 generic parameter: `T`
--> /home/stu/.cargo/registry/src/github.com-1ecc6299db9ec823/zbus-2.0.0-beta.7/src/error.rs:227:10
|
227 | pub type Result<T> = std::result::Result<T, Error>;
| ^^^^^^ -
= note: this error originates in the macro `$crate::__serialize_key` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0107`.
error: could not compile `zbus` due to 4 previous errors
The
__serialize_key
macro currently emitsResult<S::Ok, S::Error>
as the return type of the functions, which can break the macro code ifResult
is redefined (e.g.type Result<T> = ...
which is pretty common)This occurred to me while I was building
zbus
(2.0.0-beta.7) and already hadslotmap
with theserde
feature enabled inside my crate, which lead to this error: