Skip to content

Commit

Permalink
rustdoc: add fast path for empty generic args
Browse files Browse the repository at this point in the history
  • Loading branch information
fmease committed Oct 30, 2023
1 parent 5e8ecc6 commit 2f953bb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/librustdoc/clean/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ pub(crate) fn ty_args_to_args<'tcx>(
has_self: bool,
owner: DefId,
) -> Vec<GenericArg> {
// Fast path which avoids executing the query `generics_of`.
if ty_args.skip_binder().is_empty() {
return Vec::new();
}

let params = &cx.tcx.generics_of(owner).params;
let mut elision_has_failed_once_before = false;

Expand Down

0 comments on commit 2f953bb

Please sign in to comment.