Function rustdoc::html::render::search_index::add_generics_and_bounds_as_types [−][src]
fn add_generics_and_bounds_as_types<'tcx>(
generics: &Generics,
arg: &Type,
tcx: TyCtxt<'tcx>,
recurse: usize,
res: &mut Vec<TypeWithKind>
)Expand description
The point of this function is to replace bounds with types.
i.e. [T, U] when you have the following bounds: T: Display, U: Option<T> will return
[Display, Option]. If a type parameter has no trait bound, it is discarded.
Important note: It goes through generics recursively. So if you have
T: Option<Result<(), ()>>, it’ll go into Option and then into Result.
