{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreia6pwemioh34dzidl7le5q3qp7wwmsrroiamm6cqwv5vsbhvo4v3m",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mmpllmfehv52"
  },
  "path": "/t/pre-rfc-make-some-feature-detected-function-to-fn-pointer-casts-safe-through-zst-token-types/24353#post_7",
  "publishedAt": "2026-05-25T21:59:14.000Z",
  "site": "https://internals.rust-lang.org",
  "textContent": "That way of casting is an instruction I'd really like to see in `wasm` so that the environment has a choice in feature support instead of any mention of `simd128` requiring it for the whole module.\n\nAs a language feature however it would be less flexible. It works for setup function calls but is inappropriate for most runtime call dispatch. This is as would exhibit the same problem as the `is_*_feature_detect` macro itself, each evaluation loads from an atomic (to avoid the repeated cpuid) and this causes LLVM to treat the cast as a side-effect and sequence point; if you write N casts you get N loads instead of being able to re-use the feature bitmask in any way. With struct_target_feature you get to avoid that part.",
  "title": "[Pre-RFC] Make some feature-detected function-to-fn-pointer casts safe through ZST token types"
}