Suggest copying trait associated type bounds on lifetime error by jackh726 路 Pul...
source link: https://github.com/rust-lang/rust/pull/92683
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Closes #92033
Kind of the most simple suggestion to make - we don't try to be fancy. Turns out, it's still pretty useful (the couple existing tests that trigger this error end up fixed - for this error - upon applying the fix).
r? @estebank cc @nikomatsakis
@@ -64,7 +64,7 @@ impl<'cx, 'tcx> NiceRegionError<'cx, 'tcx> {
.or_else(|| self.try_report_mismatched_static_lifetime())
}
pub fn regions(&self) -> Option<(Span, ty::Region<'tcx>, ty::Region<'tcx>)> {
pub(super) fn regions(&self) -> Option<(Span, ty::Region<'tcx>, ty::Region<'tcx>)> {
let origin = SubregionOrigin::from_obligation_cause(&cause, || {
infer::RelateParamBound(cause.span, sup_type, None)
});
let origin = infer::RelateRegionParamBound(cause.span);
@@ -8,7 +8,7 @@ trait A<'a> {
// FIXME(generic_associated_types): Remove one of the below bounds
// https://github.com/rust-lang/rust/pull/90678#discussion_r744976085
where
'a: 'b, Self: 'a, Self: 'b;
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK