simplify_fn_type in rustdoc::html::render::search_index - Rust
Description: The point of this function is to lower generics and types into the simplified form that the frontend search engine can use.

Skip to main content

## simplify_fn_type

# Function simplify_fn_type

Source

    fn simplify_fn_type<'a, 'tcx>(
        self_: Option<&'a Type>,
        generics: &Generics,
        arg: &'a Type,
        tcx: TyCtxt<'tcx>,
        recurse: usize,
        rgen: &mut FxIndexMap<SimplifiedParam, (isize, Vec<RenderType>)>,
        is_return: bool,
        cache: &Cache,
    ) -> Option<RenderType>

Expand description

The point of this function is to lower generics and types into the simplified form that the frontend search engine can use.

For example, `[T, U, i32]]` where you have the bounds: `T: Display, U: Option<T>` will return `[-1, -2, i32] where -1: Display, -2: Option<-1>`. If a type parameter has no trait bound, it will still get a number. If a constraint is present but not used in the actual types, it will not be added to the map.

This function also works recursively.