Skip to content

Commit 939653f

Browse files
committed
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.
1 parent 5358e08 commit 939653f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/librustdoc/html/render/search_index.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -852,14 +852,9 @@ fn simplify_fn_type<'tcx, 'a>(
852852
(false, arg)
853853
};
854854

855-
let as_arg_s = |t: &Type| match *t {
856-
Type::Generic(arg_s) => Some(arg_s),
857-
Type::SelfTy => Some(kw::SelfUpper),
858-
_ => None,
859-
};
860855
// If this argument is a type parameter and not a trait bound or a type, we need to look
861856
// for its bounds.
862-
if let Some(arg_s) = as_arg_s(arg) {
857+
if let Type::Generic(arg_s) = *arg {
863858
// First we check if the bounds are in a `where` predicate...
864859
let mut type_bounds = Vec::new();
865860
for where_pred in generics.where_predicates.iter().filter(|g| match g {

0 commit comments

Comments
 (0)