Invert dependency between rustc_errors and rustc_abi.#154449
Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom Apr 10, 2026
Merged
Invert dependency between rustc_errors and rustc_abi.#154449rust-bors[bot] merged 2 commits intorust-lang:mainfrom
rustc_errors and rustc_abi.#154449rust-bors[bot] merged 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. |
davidtwco
approved these changes
Apr 10, 2026
Member
|
@bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Apr 10, 2026
…_abi, r=davidtwco Invert dependency between `rustc_errors` and `rustc_abi`. 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. r? @davidtwco
This was referenced Apr 10, 2026
rust-bors bot
pushed a commit
that referenced
this pull request
Apr 10, 2026
…uwer Rollup of 6 pull requests Successful merges: - #152901 (Introduce a `#[diagnostic::on_unknown]` attribute) - #155078 (Reject dangling attributes in where clauses) - #154449 (Invert dependency between `rustc_errors` and `rustc_abi`.) - #154646 (Add suggestion to `.to_owned()` used on `Cow` when borrowing) - #154993 (compiletest: pass -Zunstable-options for unpretty and no-codegen paths) - #155097 (Make `rustc_attr_parsing::SharedContext::emit_lint` take a `MultiSpan` instead of a `Span`)
rust-timer
added a commit
that referenced
this pull request
Apr 10, 2026
Rollup merge of #154449 - nnethercote:rustc_errors-dep-rustc_abi, r=davidtwco Invert dependency between `rustc_errors` and `rustc_abi`. 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. r? @davidtwco
github-actions bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Apr 13, 2026
…uwer Rollup of 6 pull requests Successful merges: - rust-lang/rust#152901 (Introduce a `#[diagnostic::on_unknown]` attribute) - rust-lang/rust#155078 (Reject dangling attributes in where clauses) - rust-lang/rust#154449 (Invert dependency between `rustc_errors` and `rustc_abi`.) - rust-lang/rust#154646 (Add suggestion to `.to_owned()` used on `Cow` when borrowing) - rust-lang/rust#154993 (compiletest: pass -Zunstable-options for unpretty and no-codegen paths) - rust-lang/rust#155097 (Make `rustc_attr_parsing::SharedContext::emit_lint` take a `MultiSpan` instead of a `Span`)
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