diff options
| author | bors <bors@rust-lang.org> | 2023-04-19 17:01:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-04-19 17:01:06 +0000 |
| commit | d3b1001ba4e7451f8ab87f35decd94d056971064 (patch) | |
| tree | 8137200c892a1efc16f9f5cb14df82152c891808 /tests/rustdoc-js-std/parser-errors.js | |
| parent | 1dfc231b10baa850b072a6c5f3d845f2e0a19d07 (diff) | |
| parent | 2ebfbc5753529cd50611605f87386c517a4a3f83 (diff) | |
| download | rust-d3b1001ba4e7451f8ab87f35decd94d056971064.tar.gz rust-d3b1001ba4e7451f8ab87f35decd94d056971064.zip | |
Auto merge of #110496 - WaffleLapkin:🏳️⚧️sound, r=compiler-errors
Don't transmute `&List<GenericArg>` <-> `&List<Ty>` In #93505 we allowed safely transmuting between `&List<GenericArg<'_>>` and `&List<Ty<'_>>`. This was possible because `GenericArg` is a tagged pointer and the tag for types is `0b00`, such that a `GenericArg` with a type inside has the same layout as `Ty`. While this was meant as an optimization, it doesn't look like it was actually any perf or max-rss win (see https://github.com/rust-lang/rust/pull/94799#issuecomment-1064340003, https://github.com/rust-lang/rust/pull/94841, https://github.com/rust-lang/rust/pull/110496#issuecomment-1513799140). Additionally the way it was done is quite fragile — `unsafe` code was not properly documented or contained in a module, types were not marked as `repr(C)` (making the transmutes possibly unsound). All of this makes the code maintenance harder and blocks other possible optimizations (as an example I've found out about these `transmutes` when my change caused them to sigsegv compiler). Thus, I think we can safely (pun intended) remove those transmutes, making maintenance easier, optimizations possible, code less cursed, etc. r? `@compiler-errors`
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions
