Skip to main content

canonical_type

Function canonical_type 

Source
pub fn canonical_type(ty: &Type) -> Type
Expand description

A type reduced to the spelling everything keys on: prelude-normalized, so std::option::Option<T> and Option<T> are one entry.

The single definition of that reduction. Two things key on it — the model’s type index (Flat::type_ref) and TypeKey — and they have to agree, so neither spells it out itself.

Deliberately prelude() rather than a source-module-aware normalization: a key must mean the same thing before and after ingestion knows what the source modules are.