mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
03a8cc7df1
safely `transmute<&List<Ty<'tcx>>, &List<GenericArg<'tcx>>>` This PR has 3 relevant steps which are is split in distinct commits. The first commit now interns `List<Ty<'tcx>>` and `List<GenericArg<'tcx>>` together, potentially reusing memory while allowing free conversions between these two using `List<Ty<'tcx>>::as_substs()` and `SubstsRef<'tcx>::try_as_type_list()`. Using this, we then use `&'tcx List<Ty<'tcx>>` instead of a `SubstsRef<'tcx>` for tuple fields, simplifying a bunch of code. Finally, as tuple fields and other generic arguments now use a different `TypeFoldable<'tcx>` impl, we optimize the impl for `List<Ty<'tcx>>` improving perf by slightly less than 1% in tuple heavy benchmarks. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |