Skip to content

Commit afb77a9

Browse files
committed
Coalesce two arguments as &Function
1 parent bd6692c commit afb77a9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/librustdoc/html/render/search_index.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use rustc_span::symbol::Symbol;
77
use serde::ser::{Serialize, SerializeStruct, Serializer};
88

99
use crate::clean;
10-
use crate::clean::types::{FnDecl, FnRetTy, GenericBound, Generics, Type, WherePredicate};
10+
use crate::clean::types::{FnRetTy, Function, GenericBound, Generics, Type, WherePredicate};
1111
use crate::formats::cache::Cache;
1212
use crate::formats::item_type::ItemType;
1313
use crate::html::markdown::short_markdown_summary;
@@ -186,9 +186,9 @@ crate fn get_index_search_type<'tcx>(
186186
tcx: TyCtxt<'tcx>,
187187
) -> Option<IndexItemFunctionType> {
188188
let (mut inputs, mut output) = match *item.kind {
189-
clean::FunctionItem(ref f) => get_all_types(&f.generics, &f.decl, tcx),
190-
clean::MethodItem(ref m, _) => get_all_types(&m.generics, &m.decl, tcx),
191-
clean::TyMethodItem(ref m) => get_all_types(&m.generics, &m.decl, tcx),
189+
clean::FunctionItem(ref f) => get_all_types(f, tcx),
190+
clean::MethodItem(ref m, _) => get_all_types(m, tcx),
191+
clean::TyMethodItem(ref m) => get_all_types(m, tcx),
192192
_ => return None,
193193
};
194194

@@ -378,10 +378,12 @@ fn get_real_types<'tcx>(
378378
/// i.e. `fn foo<A: Display, B: Option<A>>(x: u32, y: B)` will return
379379
/// `[u32, Display, Option]`.
380380
fn get_all_types<'tcx>(
381-
generics: &Generics,
382-
decl: &FnDecl,
381+
func: &Function,
383382
tcx: TyCtxt<'tcx>,
384383
) -> (Vec<TypeWithKind>, Vec<TypeWithKind>) {
384+
let decl = &func.decl;
385+
let generics = &func.generics;
386+
385387
let mut all_types = Vec::new();
386388
for arg in decl.inputs.values.iter() {
387389
if arg.type_.is_self_type() {

0 commit comments

Comments
 (0)