pub enum SubregionOrigin<'tcx> {
    Subtype(Box<TypeTrace<'tcx>>),
    RelateObjectBound(Span),
    RelateParamBound(SpanTy<'tcx>, Option<Span>),
    RelateRegionParamBound(Span),
    Reborrow(Span),
    ReborrowUpvar(SpanUpvarId),
    DataBorrowed(Ty<'tcx>, Span),
    ReferenceOutlivesReferent(Ty<'tcx>, Span),
    CompareImplItemObligation {
        span: Span,
        impl_item_def_id: LocalDefId,
        trait_item_def_id: DefId,
    },
    CheckAssociatedTypeBounds {
        parent: Box<SubregionOrigin<'tcx>>,
        impl_item_def_id: LocalDefId,
        trait_item_def_id: DefId,
    },
}
Expand description

The origin of a r1 <= r2 constraint.

See error_reporting module for more details

Variants

Subtype(Box<TypeTrace<'tcx>>)

Arose from a subtyping relation

RelateObjectBound(Span)

When casting &'a T to an &'b Trait object, relating 'a to 'b

RelateParamBound(SpanTy<'tcx>, Option<Span>)

Some type parameter was instantiated with the given type, and that type must outlive some region.

RelateRegionParamBound(Span)

The given region parameter was instantiated with a region that must outlive some other region.

Reborrow(Span)

Creating a pointer b to contents of another reference

ReborrowUpvar(SpanUpvarId)

Creating a pointer b to contents of an upvar

DataBorrowed(Ty<'tcx>, Span)

Data with type Ty<'tcx> was borrowed

ReferenceOutlivesReferent(Ty<'tcx>, Span)

(&’a &’b T) where a >= b

CompareImplItemObligation

Fields

span: Span
impl_item_def_id: LocalDefId
trait_item_def_id: DefId

Comparing the signature and requirements of an impl method against the containing trait.

CheckAssociatedTypeBounds

Fields

parent: Box<SubregionOrigin<'tcx>>
impl_item_def_id: LocalDefId
trait_item_def_id: DefId

Checking that the bounds of a trait’s associated type hold for a given impl

Implementations

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Layout

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 32 bytes

Size for each variant:

  • Subtype: 12 bytes
  • RelateObjectBound: 8 bytes
  • RelateParamBound: 28 bytes
  • RelateRegionParamBound: 8 bytes
  • Reborrow: 8 bytes
  • ReborrowUpvar: 20 bytes
  • DataBorrowed: 20 bytes
  • ReferenceOutlivesReferent: 20 bytes
  • CompareImplItemObligation: 20 bytes
  • CheckAssociatedTypeBounds: 20 bytes