Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Migrate typeck::outlives::mod.rs to SessionDiagnostic #100659

wants to merge 1 commit into from

Conversation

ameknite
Copy link
Contributor

Migration of a part of the outlive module to Session Diagnostic.
This is my first PR, I hope is ok

r? rust-lang/diagnostics

@rust-highfive
Copy link
Collaborator

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 rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 17, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 17, 2022
@ameknite
Copy link
Contributor Author

@rustbot label +A-translation

@rustbot rustbot added the A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic label Aug 17, 2022
pub pred: Vec<String>,
}

impl SessionDiagnostic<'_> for RustcOutlives {
Copy link
Member

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.

Copy link
Member

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.

@davidtwco
Copy link
Member

r? @davidtwco

@rust-highfive rust-highfive assigned davidtwco and unassigned TaKO8Ki Aug 17, 2022
@@ -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");
Copy link
Member

@davidtwco davidtwco Aug 17, 2022

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.

@bors
Copy link
Contributor

bors commented Aug 18, 2022

☔ The latest upstream changes (presumably #100708) made this pull request unmergeable. Please resolve the merge conflicts.

@ameknite ameknite closed this Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants