@@ -68,7 +68,8 @@ pub(super) const UNKNOWN_COLUMN_NUMBER: c_uint = 0;
68
68
69
69
const NO_SCOPE_METADATA : Option < & DIScope > = None ;
70
70
/// 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 ( ) ;
72
73
73
74
// SmallVec is used quite a bit in this module, so create a shorthand.
74
75
// The actual number of elements is not so important.
@@ -1287,7 +1288,7 @@ fn build_union_type_di_node<'ll, 'tcx>(
1287
1288
fn build_generic_type_param_di_nodes < ' ll , ' tcx > (
1288
1289
cx : & CodegenCx < ' ll , ' tcx > ,
1289
1290
ty : Ty < ' tcx > ,
1290
- ) -> SmallVec < & ' ll DIType > {
1291
+ ) -> SmallVec < Option < & ' ll DIType > > {
1291
1292
if let ty:: Adt ( def, args) = * ty. kind ( ) {
1292
1293
if args. types ( ) . next ( ) . is_some ( ) {
1293
1294
let generics = cx. tcx . generics_of ( def. did ( ) ) ;
@@ -1297,7 +1298,7 @@ fn build_generic_type_param_di_nodes<'ll, 'tcx>(
1297
1298
kind. as_type ( ) . map ( |ty| {
1298
1299
let actual_type = cx. tcx . normalize_erasing_regions ( cx. typing_env ( ) , ty) ;
1299
1300
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) )
1301
1302
} )
1302
1303
} )
1303
1304
. collect ( ) ;
0 commit comments