Skip to main content

Module autoderef

Module autoderef 

Source
Expand description

In certain situations, rust automatically inserts derefs as necessary: for example, field accesses foo.bar still work when foo is actually a reference to a type with the field bar. This is an approximation of the logic in rustc (which lives in rustc_hir_typeck/autoderef.rs).

Structsยง

AutoderefSnapshot ๐Ÿ”’
AutoderefTraits ๐Ÿ”’
DefaultAutoderefCtx ๐Ÿ”’
GeneralAutoderef ๐Ÿ”’
Recursively dereference a type, considering both built-in dereferences (*) and the Deref trait. Although called Autoderef it can be configured to use the Receiver trait instead of the Deref trait.
InferenceContextAutoderefCtx ๐Ÿ”’

Enumsยง

AutoderefKind ๐Ÿ”’

Constantsยง

AUTODEREF_RECURSION_LIMIT ๐Ÿ”’

Traitsยง

AutoderefCtx ๐Ÿ”’
TrackAutoderefSteps ๐Ÿ”’

Functionsยง

autoderef
Returns types that ty transitively dereferences to. This function is only meant to be used outside hir-ty.
structurally_normalize_ty ๐Ÿ”’

Type Aliasesยง

Autoderef ๐Ÿ”’
InferenceContextAutoderef ๐Ÿ”’