objc2
objc2 copied to clipboard
Unstable: `&'static str` from Encoding
Idea is that we generate an array in a const fn
, and then get a reference to that array and put it in a const
.
Requires https://github.com/rust-lang/rust/issues/76560.
Another approach would be to require Encode
implementors to add a macro to the end, like this:
unsafe impl Encode for MyType {
const ENCODING: Encoding<'static> = ...;
end_encode_impl!();
}
Though of course https://github.com/rust-lang/const-eval/issues/20 would make this much, much easier!