Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dogfood TransmuteFrom in the Rust standard library #20

Open
jswrenn opened this issue Sep 14, 2024 · 0 comments
Open

Dogfood TransmuteFrom in the Rust standard library #20

jswrenn opened this issue Sep 14, 2024 · 0 comments

Comments

@jswrenn
Copy link
Member

jswrenn commented Sep 14, 2024

There are many instances of transmutation in the compiler, both used as a documented type-level bound (e.g., "this associated type must be transmutable into Self) and as a concrete operation. We should dogfood TransmuteFrom by replacing as many instances of documented transmutation bounds with TransmuteFrom and concrete transmutes with TransmuteFrom::transmute. This both will reduce the amount of unsafe in the Rust standard library and make unavoidable unsafe a little less dangerous.

Blockers:

  • Until Implement intrinsic matching semantics of TransmuteFrom::transmute #18 is resolved, replacing mem::transmute with TransmuteFrom::transmute might regress codegen/performance
  • At a type level, there are still rough edges with TransmuteFrom. It's slow to analyze very large types, and does not yet normalize associated types on traits (and thus cannot analyze them).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant