-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 rustc_codegen_llvm to SessionDiagnostics #101005
Migrate rustc_codegen_llvm to SessionDiagnostics #101005
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @oli-obk (or someone else) soon. Please see the contribution instructions for more information. |
r? @davidtwco (I'm still catching up) |
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 is a great start!
773d3c8
to
6b8539a
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #100732) made this pull request unmergeable. Please resolve the merge conflicts. |
fc3bcde
to
79ff769
Compare
This comment has been minimized.
This comment has been minimized.
@davidtwco Two last things that block this are those two calls to the Handler. And I've found one method that makes use of the Handler too. |
You might just need to skip these for now, otherwise we would have to change |
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 looks great, left a couple comments
cx.tcx | ||
.sess | ||
.create_err(TargetFeatureDisableOrEnable { features: f, span: Some(span) }) | ||
.subdiagnostic(MissingFeatures) |
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.
Why can't you just add a #[help]
to the type of TargetFeatureDisableOrEnable
?
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.
TargetFeatureDisableOrEnable
is present in llvm_util.rs, but without the help
. I was thinking of splitting them into separate diagnostics, and then I could just add #[help]
as you proposed.
https://github.com/rust-lang/rust/blob/2227d5117d0d8fe9d897bb3a2d020e75bb3edad5/compiler/rustc_codegen_llvm/src/llvm_util.rs#L497-L502
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.
Other solution could be usage of enums instead of struct here. That would boil down to the same problem as the other comment here.
This comment was marked as resolved.
This comment was marked as resolved.
Hi, I've seen you changed some diagnostic structs in your PR. After #103345, the way we refer to fluent messages changed. They are now in a flat namespace with the same identifier as in the fluent file. For example, |
2227d51
to
48758e7
Compare
This comment has been minimized.
This comment has been minimized.
@davidtwco I've ported remaining two diagnostics and changed old ones, which were implemented manually. However, it seems like rust/compiler/rustc_codegen_ssa/src/back/write.rs Lines 1734 to 1742 in e96c330
|
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
Are you able to change rust/compiler/rustc_codegen_ssa/src/back/write.rs Line 1748 in e96c330
I guess you'll also need to keep track of the diagnostic arguments in I'm assuming that diagnostics emitted from |
I was able to change |
Feel free to commit them to this branch. |
Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
eb829d6
to
39895b0
Compare
Sorry, I've used GitHub's feature and didn't check properly that it would do the merge commit. |
@bors r=davidtwco |
@SLASHLogin: 🔑 Insufficient privileges: Not in reviewers |
r? davidtwco |
Could not assign reviewer from: |
@bors r+ |
…nostics, r=davidtwco Migrate rustc_codegen_llvm to SessionDiagnostics WIP: Port current implementation of diagnostics to the new SessionDiagnostics. Part of rust-lang#100717 `@rustbot` label +A-translation
…nostics, r=davidtwco Migrate rustc_codegen_llvm to SessionDiagnostics WIP: Port current implementation of diagnostics to the new SessionDiagnostics. Part of rust-lang#100717 ``@rustbot`` label +A-translation
…earth Rollup of 9 pull requests Successful merges: - rust-lang#101005 (Migrate rustc_codegen_llvm to SessionDiagnostics) - rust-lang#103307 (Add context to compiler error message) - rust-lang#103464 (Add support for custom mir) - rust-lang#103929 (Cleanup Apple-related code in rustc_target) - rust-lang#104015 (Remove linuxkernel targets) - rust-lang#104020 (Limit efiapi calling convention to supported arches) - rust-lang#104156 (Cleanups in autoderef impl) - rust-lang#104171 (Update books) - rust-lang#104184 (Fix `rustdoc --version` when used with download-rustc) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
WIP: Port current implementation of diagnostics to the new SessionDiagnostics.
Part of #100717
@rustbot label +A-translation