Skip to content

Commit 2a31e68

Browse files
committed
Guard a query invocation out of perf reasons
1 parent 87e60a7 commit 2a31e68

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1314,8 +1314,10 @@ fn build_generic_type_param_di_nodes<'ll, 'tcx>(
13141314
ty: Ty<'tcx>,
13151315
) -> SmallVec<Option<&'ll DIType>> {
13161316
if let ty::Adt(def, args) = *ty.kind() {
1317-
let generics = cx.tcx.generics_of(def.did());
1318-
return get_template_parameters(cx, generics, args);
1317+
if args.types().next().is_some() {
1318+
let generics = cx.tcx.generics_of(def.did());
1319+
return get_template_parameters(cx, generics, args);
1320+
}
13191321
}
13201322

13211323
return smallvec![];

0 commit comments

Comments
 (0)