-
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
Migrate typeck::outlives::mod.rs to SessionDiagnostic #100659
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @TaKO8Ki (or someone else) soon. Please see the contribution instructions for more information. |
@rustbot label +A-translation |
pub pred: Vec<String>, | ||
} | ||
|
||
impl SessionDiagnostic<'_> for RustcOutlives { |
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 should not use a manual implementation of SessionDiagnostic
but instead be using the derive macro, I think.
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.
Yeah, you will be able to simplify this with a diagnostic derive, you can see examples in the blog post.
r? @davidtwco |
@@ -59,12 +61,7 @@ fn inferred_outlives_of(tcx: TyCtxt<'_>, item_def_id: DefId) -> &[(ty::Predicate | |||
.collect(); | |||
pred.sort(); | |||
|
|||
let span = tcx.def_span(item_def_id); | |||
let mut err = tcx.sess.struct_span_err(span, "rustc_outlives"); |
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.
pre-existing: this is a bizarre error message.. and the blame is from many years ago.
☔ The latest upstream changes (presumably #100708) made this pull request unmergeable. Please resolve the merge conflicts. |
Migration of a part of the outlive module to Session Diagnostic.
This is my first PR, I hope is ok
r? rust-lang/diagnostics