rust/compiler
bors df0d9b492d 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`
2023-04-19 17:01:06 +00:00
..
rustc
rustc_abi Store hashes in special types so they aren't accidentally encoded as numbers 2023-04-18 10:52:47 -04:00
rustc_apfloat
rustc_arena
rustc_ast Auto merge of #110393 - fee1-dead-contrib:rm-const-traits, r=oli-obk 2023-04-19 13:03:40 +00:00
rustc_ast_lowering Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_ast_passes Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_ast_pretty
rustc_attr Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_baked_icu_data
rustc_borrowck Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_builtin_macros Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_codegen_cranelift
rustc_codegen_gcc Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_codegen_llvm Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_codegen_ssa Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_const_eval Auto merge of #110393 - fee1-dead-contrib:rm-const-traits, r=oli-obk 2023-04-19 13:03:40 +00:00
rustc_data_structures Auto merge of #110083 - saethlin:encode-hashes-as-bytes, r=cjgillot 2023-04-18 22:27:15 +00:00
rustc_driver
rustc_driver_impl Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_error_codes
rustc_error_messages Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_errors Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_expand Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_feature
rustc_fluent_macro Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_fs_util
rustc_graphviz
rustc_hir Store hashes in special types so they aren't accidentally encoded as numbers 2023-04-18 10:52:47 -04:00
rustc_hir_analysis Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_hir_pretty
rustc_hir_typeck Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_incremental Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_index Don't allocate it IndexVec::remove 2023-04-18 12:55:54 +00:00
rustc_infer Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_interface Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_lexer
rustc_lint Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_lint_defs
rustc_llvm
rustc_log
rustc_macros Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_metadata Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_middle Auto merge of #110496 - WaffleLapkin:🏳️‍⚧️sound, r=compiler-errors 2023-04-19 17:01:06 +00:00
rustc_mir_build Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_mir_dataflow Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_mir_transform Auto merge of #110477 - miguelraz:canoodling2-electric-boogaloo, r=compiler-errors 2023-04-19 02:57:19 +00:00
rustc_monomorphize Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_parse Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_parse_format
rustc_passes Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_plugin_impl Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_privacy Add rustc_fluent_macro to decouple fluent from rustc_macros 2023-04-18 18:56:22 +00:00
rustc_query_impl Rollup merge of #110498 - kylematsuda:earlybinder-rpitit-tys, r=compiler-errors 2023-04-19 06:35:35 +02:00
rustc_query_system Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_resolve Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_serialize
rustc_session Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_smir
rustc_span Rollup merge of #110432 - compiler-errors:unsatisfied-index-impl, r=cjgillot 2023-04-19 06:35:34 +02:00
rustc_symbol_mangling Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_target
rustc_trait_selection Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_traits Don't transmute &List<GenericArg> <-> &List<Ty> 2023-04-18 17:42:30 +00:00
rustc_transmute
rustc_ty_utils Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwco 2023-04-19 08:26:47 +00:00
rustc_type_ir