it's if constexpr!
in C++ i can do this (contrived, i know, but bear with me):
template<typename T>
void foo() {
if constexpr (std::integral<T>) {
// this code is only compiled if T models std::integral
} else {
// this code is compiled in all other cases
}
}
as far as i can tell, Rust has no equivalent for this (though i would be happy to be proven wrong). the only conditional compilation mechanism i'm aware of is #[cfg(...)], and i think this is not aware of the trait system or anything like that. in particular, i think you can't have the type/lifetime parameters of a generic function influence conditional compilation.
it is somewhat niche, but it can get you some very compact intuitive code, especially when one branch won't even compile for one case but will for the other. it's like getting two functions in one.

eggbug enjoyer