-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggest copying trait associated type bounds on lifetime error #92683
Conversation
@@ -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>)> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive by change.
let origin = SubregionOrigin::from_obligation_cause(&cause, || { | ||
infer::RelateParamBound(cause.span, sup_type, None) | ||
}); | ||
let origin = infer::RelateRegionParamBound(cause.span); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the one below are drive-by changes. These shouldn't ever be displayed anyways. But wanted to stop using from_obligation_cause
(was potentially going a different direction for this PR).
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bound was required because of a bug that has since been fixed. FIXME still stands for the two remaining though.
r=me but I'll let @estebank do a review if he wants to |
☔ The latest upstream changes (presumably #92927) made this pull request unmergeable. Please resolve the merge conflicts. |
9bac686
to
814a62d
Compare
☔ The latest upstream changes (presumably #92007) made this pull request unmergeable. Please resolve the merge conflicts. |
r=me after fixing rebase |
814a62d
to
3d19c8d
Compare
@bors r=estebank |
📌 Commit 3d19c8d has been approved by |
Suggest copying trait associated type bounds on lifetime error Closes rust-lang#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`
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#92683 (Suggest copying trait associated type bounds on lifetime error) - rust-lang#92933 (Deny mixing bin crate type with lib crate types) - rust-lang#92959 (Add more info and suggestions to use of #[test] on invalid items) - rust-lang#93024 (Do not ICE when inlining a function with un-satisfiable bounds) - rust-lang#93613 (Move `{core,std}::stream::Stream` to `{core,std}::async_iter::AsyncIterator`) - rust-lang#93634 (compiler: clippy::complexity fixes) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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