rustdoc: Stop treating Self as a generic in search index

We already have special-cased code to handle inlining `Self` as the type
or trait it refers to, and this was just causing glitches like the
search `A -> B` yielding blanket `Into` impls.
This commit is contained in:
Noah Lev 2024-07-31 17:06:32 -07:00
parent 664b3ffbe9
commit 4e348fa803

View File

@ -852,14 +852,9 @@ fn simplify_fn_type<'tcx, 'a>(
(false, arg)
};
let as_arg_s = |t: &Type| match *t {
Type::Generic(arg_s) => Some(arg_s),
Type::SelfTy => Some(kw::SelfUpper),
_ => None,
};
// If this argument is a type parameter and not a trait bound or a type, we need to look
// for its bounds.
if let Some(arg_s) = as_arg_s(arg) {
if let Type::Generic(arg_s) = *arg {
// First we check if the bounds are in a `where` predicate...
let mut type_bounds = Vec::new();
for where_pred in generics.where_predicates.iter().filter(|g| match g {