Invert dependency between rustc_errors and rustc_abi.#154449
Open
nnethercote wants to merge 2 commits intorust-lang:mainfrom
Open
Invert dependency between rustc_errors and rustc_abi.#154449nnethercote wants to merge 2 commits intorust-lang:mainfrom
rustc_errors and rustc_abi.#154449nnethercote wants to merge 2 commits intorust-lang:mainfrom
Conversation
Collaborator
|
These commits modify compiler targets.
cc @TaKO8Ki These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
650aac9 to
2f9b158
Compare
This comment has been minimized.
This comment has been minimized.
2f9b158 to
4b44bf0
Compare
Contributor
Author
Currently, `rustc_errors` depends on `rustc_abi`, which depends on `rustc_error_messages`. This is a bit odd. `rustc_errors` depends on `rustc_abi` for a single reason: `rustc_abi` defines a type `TargetDataLayoutErrors` and `rustc_errors` impls `Diagnostic` for that type. We can get a more natural relationship by inverting the dependency, moving the `Diagnostic` trait upstream. Then `rustc_abi` defines `TargetDataLayoutErrors` and also impls `Diagnostic` for it. `rustc_errors` is already pretty far upstream in the crate graph, it doesn't hurt to push it a little further because errors are a very low-level concept.
Error enum names should not be plural. Even though there are multiple possible errors, each instance of an error enum describes a single error. There are dozens of singular error enum names, and only two plural error enum names. This commit makes them both singular.
4b44bf0 to
0db4e3a
Compare
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Currently,
rustc_errorsdepends onrustc_abi, which depends onrustc_error_messages. This is a bit odd.rustc_errorsdepends onrustc_abifor a single reason:rustc_abidefines a typeTargetDataLayoutErrorsandrustc_errorsimplsDiagnosticfor that type.We can get a more natural relationship by inverting the dependency, moving the
Diagnostictrait upstream. Thenrustc_abidefinesTargetDataLayoutErrorsand also implsDiagnosticfor it.rustc_errorsis already pretty far upstream in the crate graph, it doesn't hurt to push it a little further because errors are a very low-level concept.r? @davidtwco