Repository navigation
Commit 86a6880
committed
refactor(server): use wildcard fallback for compiled-out compute drivers
Replace the `#[cfg(not(all(feature = "driver-*")))]`-gated
`ConfiguredComputeDriver::Builtin(kind)` catch-all in the dispatch
match with a plain `_ => unreachable!(...)` guarded by
`#[allow(unreachable_patterns)]`. Adding or removing a driver feature
no longer requires updating this arm, and there is no feature list to
drift out of sync with the enum.
The arm remains genuinely unreachable at runtime: config validation in
`configured_compute_driver` rejects builtins whose feature was compiled
out before dispatch runs. The trade-off is that the panic message no
longer names the specific driver — acceptable because the actionable
error operators see is the validation-layer message, which does name
the driver and the Cargo feature that re-enables it.
Signed-off-by: Dimitar Mirchev <[email protected]>1 parent 61529cf commit 86a6880
1 file changed
Lines changed: 10 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | | - | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
838 | 833 | | |
839 | 834 | | |
840 | 835 | | |
| |||
0 commit comments