Unfortunately, we are not at the point where this can even be reliably done. This needs some cross-cutting changes through LLVM and Rust to give the compiler an understanding of what the "secrets" are, so that it can preserve the property that "if the source code does not leak secrets, then the compiled program does not leak them either".
But anyway that's largely orthogonal to freeze
; obviously attackers wouldn't be stopped by what you can or cannot do in UB-free Rust. If your program does have unrelated UB, whether or not Rust has freeze
does not matter any more.