cehteh
August 13, 2026, 6:21pm
1
crates.io: Rust Package Registry (my entry to the worst crate name competition ;))
It implements compile-time errors when unsupported code paths are actually taken.
This helps to get rid of runtime panics from using todo!() or unimplemented!().
It also allows a novel programing pattern allowing traits with optional methods that the user only needs to implement when they are actually used.
It is a very small crate, I was honestly surprised such didn't already exist, still I believe it was worthwhile to publish as a crate.
leudz
August 13, 2026, 7:08pm
2
I feel like you either:
Won a million dollars
Embellished your crate's description a bit too much
Given this code fails to compile, I would go with 2.
fn main() {
if false {
unsupported::unsupported!()
}
}
(I think I understand what your crate does but the wording makes it seem like it does more)
cehteh
August 13, 2026, 7:15pm
3
agreed, this should need some rewording, i am just lack better ideas here that are not overly complicated "compile error when a code path that contains unsupported!() is instantiated" is a bit wordy and hard to understand either. Help welcome.
miro
August 13, 2026, 7:21pm
4
looking at how the macro just boils down to const { panic! } you could just say that it causes a compiler error when const { panic! } would cause one.
you could also say "unsupported causes a compiler error if it would be const evaluated" and link to Constant evaluation - The Rust Reference
cehteh
August 13, 2026, 8:08pm
5
The important point is that we defer this const-panic until the code becomes monomorphized. Unlike a plain const {panic} which would trigger a compile error instantly.