diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2024-07-31 17:06:32 -0700 |
|---|---|---|
| committer | Noah Lev <camelidcamel@gmail.com> | 2024-08-04 12:49:28 -0700 |
| commit | 4e348fa803723a38553138d9795cb2c6b7fb964a (patch) | |
| tree | 678188024691b7a9e0bb479fc90a7ebff1c0b997 | |
| parent | 664b3ffbe932d93677ac7dff52252e02aee60ef9 (diff) | |
| download | rust-4e348fa803723a38553138d9795cb2c6b7fb964a.tar.gz rust-4e348fa803723a38553138d9795cb2c6b7fb964a.zip | |
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.
| -rw-r--r-- | src/librustdoc/html/render/search_index.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/librustdoc/html/render/search_index.rs b/src/librustdoc/html/render/search_index.rs index fc3d6c99b80..e4d948b8c9c 100644 --- a/src/librustdoc/html/render/search_index.rs +++ b/src/librustdoc/html/render/search_index.rs @@ -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 { |
