[][src]Module rustc_data_structures::tagged_ptr

This module implements tagged pointers.

In order to utilize the pointer packing, you must have two types: a pointer, and a tag.

The pointer must implement the Pointer trait, with the primary requirement being conversion to and from a usize. Note that the pointer must be dereferenceable, so raw pointers generally cannot implement the Pointer trait. This implies that the pointer must also be nonzero.

Many common pointer types already implement the Pointer trait.

The tag must implement the Tag trait. We assert that the tag and Pointer are compatible at compile time.

Modules

copy
drop

Structs

CopyTaggedPtr

A Copy TaggedPtr.

TaggedPtr

A TaggedPtr implementing Drop.

Traits

Pointer

This describes the pointer type encapsulated by TaggedPtr.

Tag

This describes tags that the TaggedPtr struct can hold.