File tree 2 files changed +10
-3
lines changed
compiler/rustc_codegen_llvm/src
src/test/ui/const-generics/issues
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>(
43
43
// FIXME(eddyb) producing readable type names for trait objects can result
44
44
// in problematically distinct types due to HRTB and subtyping (see #47638).
45
45
// 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
+ {
47
49
let mut name = with_no_trimmed_paths ( || layout. ty . to_string ( ) ) ;
48
50
if let ( & ty:: Adt ( def, _) , & Variants :: Single { index } ) =
49
51
( layout. ty . kind ( ) , & layout. variants )
@@ -59,6 +61,12 @@ fn uncached_llvm_type<'a, 'tcx>(
59
61
}
60
62
Some ( name)
61
63
}
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
+ }
62
70
_ => None ,
63
71
} ;
64
72
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
3
2
4
3
#![ allow( incomplete_features) ]
5
4
#![ feature( const_generics) ]
You can’t perform that action at this time.
0 commit comments