Function rustdoc::html::render::search_index::add_generics_and_bounds_as_types
source · fn add_generics_and_bounds_as_types<'tcx, 'a>(
self_: Option<&'a Type>,
generics: &Generics,
arg: &'a Type,
tcx: TyCtxt<'tcx>,
recurse: usize,
res: &mut Vec<RenderType>,
cache: &Cache
)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.