Point at explicit 'static obligations on a trait · rust-lang/rust@f5bae72 (original) (raw)

`@@ -390,7 +390,7 @@ pub enum SubregionOrigin<'tcx> {

`

390

390

``

391

391

`/// The given region parameter was instantiated with a region

`

392

392

`/// that must outlive some other region.

`

393

``

`-

RelateRegionParamBound(Span),

`

``

393

`+

RelateRegionParamBound(Span, Option<Ty<'tcx>>),

`

394

394

``

395

395

`` /// Creating a pointer b to contents of another reference.

``

396

396

`Reborrow(Span),

`

`@@ -859,7 +859,7 @@ impl<'tcx> InferCtxt<'tcx> {

`

859

859

`) {

`

860

860

`self.enter_forall(predicate, |ty::OutlivesPredicate(r_a, r_b)| {

`

861

861

`let origin = SubregionOrigin::from_obligation_cause(cause, || {

`

862

``

`-

RelateRegionParamBound(cause.span)

`

``

862

`+

RelateRegionParamBound(cause.span, None)

`

863

863

`});

`

864

864

`` self.sub_regions(origin, r_b, r_a); // b : a ==> a <= b

``

865

865

`})

`

`@@ -1685,7 +1685,7 @@ impl<'tcx> SubregionOrigin<'tcx> {

`

1685

1685

`Subtype(ref a) => a.span(),

`

1686

1686

`RelateObjectBound(a) => a,

`

1687

1687

`RelateParamBound(a, ..) => a,

`

1688

``

`-

RelateRegionParamBound(a) => a,

`

``

1688

`+

RelateRegionParamBound(a, _) => a,

`

1689

1689

`Reborrow(a) => a,

`

1690

1690

`ReferenceOutlivesReferent(_, a) => a,

`

1691

1691

`CompareImplItemObligation { span, .. } => span,

`

`@@ -1726,6 +1726,10 @@ impl<'tcx> SubregionOrigin<'tcx> {

`

1726

1726

`SubregionOrigin::AscribeUserTypeProvePredicate(span)

`

1727

1727

`}

`

1728

1728

``

``

1729

`+

traits::ObligationCauseCode::ObjectTypeBound(ty, _reg) => {

`

``

1730

`+

SubregionOrigin::RelateRegionParamBound(cause.span, Some(ty))

`

``

1731

`+

}

`

``

1732

+

1729

1733

` _ => default(),

`

1730

1734

`}

`

1731

1735

`}

`