about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/debuginfo
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-02-21 16:03:38 +0000
committerbors <bors@rust-lang.org>2022-02-21 16:03:38 +0000
commit03a8cc7df1d65554a4d40825b0490c93ac0f0236 (patch)
treec56dda3c041905a13e82de2cf2961caf72f7b7cc /compiler/rustc_codegen_ssa/src/debuginfo
parent1103d2e914b67c18b0deb86073c26c6aefda761d (diff)
parent80f56cdc2a749f1262518d2aa7597cf908b9e059 (diff)
downloadrust-03a8cc7df1d65554a4d40825b0490c93ac0f0236.tar.gz
rust-03a8cc7df1d65554a4d40825b0490c93ac0f0236.zip
Auto merge of #93505 - lcnr:substsref-vs-ty-list, r=michaelwoerister
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.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/debuginfo')
-rw-r--r--compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs
index b63851c195d..1561277b704 100644
--- a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs
+++ b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs
@@ -86,7 +86,7 @@ fn push_debuginfo_type_name<'tcx>(
             }
 
             for component_type in component_types {
-                push_debuginfo_type_name(tcx, component_type.expect_ty(), true, output, visited);
+                push_debuginfo_type_name(tcx, component_type, true, output, visited);
                 push_arg_separator(cpp_like_debuginfo, output);
             }
             if !component_types.is_empty() {