Create a more rigid overseer builder pattern that fails at compile time (#4753)

Introduces `Missing<Field>` and `Init<Field>` states, that are used in place of builder generics, and make this possible.
This commit is contained in:
Vsevolod Stakhov
2022-02-09 16:01:16 +00:00
committed by GitHub
parent 227e39bff6
commit 84f55cc8d5
20 changed files with 891 additions and 267 deletions
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `std::convert::From<MsgStrukt>` for type `AllMessages`
--> $DIR/err-01-duplicate-consumer.rs:19:1
--> tests/ui/err-01-duplicate-consumer.rs:19:1
|
19 | #[overlord(signal=SigSigSig, event=Event, gen=AllMessages, error=OverseerError)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -10,7 +10,7 @@ error[E0119]: conflicting implementations of trait `std::convert::From<MsgStrukt
= note: this error originates in the attribute macro `overlord` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0119]: conflicting implementations of trait `polkadot_overseer_gen::SubsystemSender<MsgStrukt>` for type `OverseerSubsystemSender`
--> $DIR/err-01-duplicate-consumer.rs:19:1
--> tests/ui/err-01-duplicate-consumer.rs:19:1
|
19 | #[overlord(signal=SigSigSig, event=Event, gen=AllMessages, error=OverseerError)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^