File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
compiler/rustc_codegen_llvm/src
src/test/ui/const-generics/issues Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,9 @@ fn uncached_llvm_type<'a, 'tcx>(
4343 // FIXME(eddyb) producing readable type names for trait objects can result
4444 // in problematically distinct types due to HRTB and subtyping (see #47638).
4545 // ty::Dynamic(..) |
46- ty:: Adt ( ..) | ty:: Closure ( ..) | ty:: Foreign ( ..) | ty:: Generator ( ..) | ty:: Str => {
46+ ty:: Adt ( ..) | ty:: Closure ( ..) | ty:: Foreign ( ..) | ty:: Generator ( ..) | ty:: Str
47+ if !cx. sess ( ) . fewer_names ( ) =>
48+ {
4749 let mut name = with_no_trimmed_paths ( || layout. ty . to_string ( ) ) ;
4850 if let ( & ty:: Adt ( def, _) , & Variants :: Single { index } ) =
4951 ( layout. ty . kind ( ) , & layout. variants )
@@ -59,6 +61,12 @@ fn uncached_llvm_type<'a, 'tcx>(
5961 }
6062 Some ( name)
6163 }
64+ ty:: Adt ( ..) => {
65+ // If `Some` is returned then a named struct is created in LLVM. Name collisions are
66+ // avoided by LLVM (with increasing suffixes). If rustc doesn't generate names then that
67+ // can improve perf.
68+ Some ( String :: new ( ) )
69+ }
6270 _ => None ,
6371 } ;
6472
Original file line number Diff line number Diff line change 1- // ignore-test
2- // FIXME(const_generics): This test causes an ICE after reverting #76030.
1+ // build-pass
32
43#![ allow( incomplete_features) ]
54#![ feature( const_generics) ]
You can’t perform that action at this time.
0 commit comments