Skip to content

Commit 2f953bb

Browse files
committed
rustdoc: add fast path for empty generic args
1 parent 5e8ecc6 commit 2f953bb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/librustdoc/clean/utils.rs

+5
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ pub(crate) fn ty_args_to_args<'tcx>(
8181
has_self: bool,
8282
owner: DefId,
8383
) -> Vec<GenericArg> {
84+
// Fast path which avoids executing the query `generics_of`.
85+
if ty_args.skip_binder().is_empty() {
86+
return Vec::new();
87+
}
88+
8489
let params = &cx.tcx.generics_of(owner).params;
8590
let mut elision_has_failed_once_before = false;
8691

0 commit comments

Comments
 (0)