Struct rustc::middle::ty::TypeContents[src]

pub struct TypeContents {
    pub bits: u64,
}

Type contents is how the type checker reasons about kinds. They track what kinds of things are found within a type. You can think of them as kind of an "anti-kind". They track the kinds of values and thinks that are contained in types. Having a larger contents for a type tends to rule that type out from various kinds. For example, a type that contains a reference is not sendable.

The reason we compute type contents and not kinds is that it is easier for me (nmatsakis) to think about what is contained within a type than to think about what is not contained within a type.

Fields

bits

Methods

impl TypeContents

fn meets_bound(&self, cx: &ctxt, bb: BuiltinBound) -> bool

fn when(&self, cond: bool) -> TypeContents

fn intersects(&self, tc: TypeContents) -> bool

fn is_static(&self, _: &ctxt) -> bool

fn is_sendable(&self, _: &ctxt) -> bool

fn is_sharable(&self, _: &ctxt) -> bool

fn owns_managed(&self) -> bool

fn owns_owned(&self) -> bool

fn is_sized(&self, _: &ctxt) -> bool

fn is_copy(&self, _: &ctxt) -> bool

fn interior_unsafe(&self) -> bool

fn interior_unsized(&self) -> bool

fn moves_by_default(&self, _: &ctxt) -> bool

fn needs_drop(&self, _: &ctxt) -> bool

fn owned_pointer(&self) -> TypeContents

Includes only those bits that still apply when indirected through a Box pointer

fn reference(&self, bits: TypeContents) -> TypeContents

Includes only those bits that still apply when indirected through a reference (&)

fn managed_pointer(&self) -> TypeContents

Includes only those bits that still apply when indirected through a managed pointer (@)

fn unsafe_pointer(&self) -> TypeContents

Includes only those bits that still apply when indirected through an unsafe pointer (*)

fn union<T>(v: &[T], f: |&T| -> TypeContents) -> TypeContents

fn has_dtor(&self) -> bool

Trait Implementations

impl BitOr<TypeContents, TypeContents> for TypeContents

fn bitor(&self, other: &TypeContents) -> TypeContents

impl BitAnd<TypeContents, TypeContents> for TypeContents

fn bitand(&self, other: &TypeContents) -> TypeContents

impl Sub<TypeContents, TypeContents> for TypeContents

fn sub(&self, other: &TypeContents) -> TypeContents

impl Show for TypeContents

fn fmt(&self, f: &mut Formatter) -> Result