@@ -68,7 +68,8 @@ pub(super) const UNKNOWN_COLUMN_NUMBER: c_uint = 0;
6868
6969const NO_SCOPE_METADATA : Option < & DIScope > = None ;
7070/// A function that returns an empty list of generic parameter debuginfo nodes.
71- const NO_GENERICS : for <' ll > fn ( & CodegenCx < ' ll , ' _ > ) -> SmallVec < & ' ll DIType > = |_| SmallVec :: new ( ) ;
71+ const NO_GENERICS : for <' ll > fn ( & CodegenCx < ' ll , ' _ > ) -> SmallVec < Option < & ' ll DIType > > =
72+ |_| SmallVec :: new ( ) ;
7273
7374// SmallVec is used quite a bit in this module, so create a shorthand.
7475// The actual number of elements is not so important.
@@ -1287,7 +1288,7 @@ fn build_union_type_di_node<'ll, 'tcx>(
12871288fn build_generic_type_param_di_nodes < ' ll , ' tcx > (
12881289 cx : & CodegenCx < ' ll , ' tcx > ,
12891290 ty : Ty < ' tcx > ,
1290- ) -> SmallVec < & ' ll DIType > {
1291+ ) -> SmallVec < Option < & ' ll DIType > > {
12911292 if let ty:: Adt ( def, args) = * ty. kind ( ) {
12921293 if args. types ( ) . next ( ) . is_some ( ) {
12931294 let generics = cx. tcx . generics_of ( def. did ( ) ) ;
@@ -1297,7 +1298,7 @@ fn build_generic_type_param_di_nodes<'ll, 'tcx>(
12971298 kind. as_type ( ) . map ( |ty| {
12981299 let actual_type = cx. tcx . normalize_erasing_regions ( cx. typing_env ( ) , ty) ;
12991300 let actual_type_di_node = type_di_node ( cx, actual_type) ;
1300- cx. create_template_type_parameter ( name. as_str ( ) , actual_type_di_node)
1301+ Some ( cx. create_template_type_parameter ( name. as_str ( ) , actual_type_di_node) )
13011302 } )
13021303 } )
13031304 . collect ( ) ;
0 commit comments