Rollup of 6 pull requests - #163105
Closed
JonathanBrouwer wants to merge 18 commits into
Closed
Rollup of 6 pull requests#163105JonathanBrouwer wants to merge 18 commits into
JonathanBrouwer wants to merge 18 commits into
Conversation
E0782 pointed only at the trait, leaving the segment that actually failed to resolve unmarked unless it was close enough to suggest a typo fix.
Point at item that introduced an unmet bound and in the case of associated items, their container (trait/impl), without using a span label. This adds bits of code to the diagnostic, without explicitly pointing to it.
```
error[E0277]: cannot add `<T as SubEncoder>::ActualSize` to `<T as SubEncoder>::ActualSize`
--> $DIR/issue-54108.rs:23:17
|
LL | type Size = <Self as SubEncoder>::ActualSize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `<T as SubEncoder>::ActualSize + <T as SubEncoder>::ActualSize`
|
= help: the trait `Add` is not implemented for `<T as SubEncoder>::ActualSize`
note: required by a bound in `Encoder::Size`
--> $DIR/issue-54108.rs:8:16
|
LL | pub trait Encoder {
LL | type Size: Add<Output = Self::Size>;
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size`
```
It encodes the `emit` behaviour, one of: - `BugAbort`: Abort as a bug. - `FatalAbort`: Abort as a fatal error. - `ErrorGuaranteed`: Return an `ErrorGuaranteed` (the default). - `()`: return `()`. This is useful but `Diag` is very widely used and it's arguably not useful enough to be worth the generic parameter. This commit removes it. Benefits: - Many fewer generic parameters, including many functions where the genericity is entirely uninteresting. This includes every `Diagnostic::into_diag` and `Subdiagnostic::add_to_diag`. Removes the need for the comment about `<G>` on `trait Diagnostic`. - No `PhantomData` in `Diag`. - Makes bootstrapping a bit faster. The downside is there is no longer a single `emit` method. - Getting a `!` return type requires calling `emit_bug` or `emit_fatal`. This only affects a few call sites. - Getting an `ErrorGuaranteed` return type requires calling `emit_err`. This affects a lot of call sites. (It arguably makes call sites more self-documenting.) - Using the wrong `emit_*` on a diagnostic causes a runtime abort, which previously couldn't occur. Seems unlikely, but it's not impossible. - Note: If no particular return type is needed, `emit` can be used for any diagnostic. (Bug/fatal diagnostics will still trigger abort.)
Remove `G` generic param from `Diag<'_, G>` The benefits are outweighed by the costs. Details in invidual commits. some minor earlier discussion about this change in rust-lang#162630 (comment)
…bjorn3 Staticlib rename internal symbols: add COFF support Follow-up to rust-lang#156950. `-Zstaticlib-rename-internal-symbols` now also works on COFF targets (Windows). Renaming only rewrites symbol names, so unlike hide it needs no visibility concept. COFF objects keep their string table at the end of the file, so renames append the new names there and patch the 4-byte length prefix plus each symbol's name offset in place. Both regular and bigobj objects are handled; on i686 a leading underscore is stripped when matching against the exported set. The archive format differs (GNU ar on windows-gnu, COFF on windows-msvc) but the members are always COFF objects, so the existing archive code is unchanged. Supported on ELF, Apple, and COFF targets. `-Zstaticlib-hide-internal-symbols` remains ELF/Apple-only and still warns on Windows. A run-make test `staticlib-rename-internal-symbols-coff` mirrors the existing ELF and Mach-O tests. r? @bjorn3
…orrow-rustfix, r=mejrs Preserve parentheses in raw borrow suggestions Fixes rust-lang#161693
…=oli-obk
Use span context for enclosing item(s) of unmet bound
Point at item that introduced an unmet bound and in the case of associated items, their container (trait/impl), without using a span label. This adds bits of code to the diagnostic, without explicitly pointing to it.
```
error[E0277]: cannot add `<T as SubEncoder>::ActualSize` to `<T as SubEncoder>::ActualSize`
--> $DIR/issue-54108.rs:23:17
|
LL | type Size = <Self as SubEncoder>::ActualSize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `<T as SubEncoder>::ActualSize + <T as SubEncoder>::ActualSize`
|
= help: the trait `Add` is not implemented for `<T as SubEncoder>::ActualSize`
note: required by a bound in `Encoder::Size`
--> $DIR/issue-54108.rs:8:16
|
LL | pub trait Encoder {
LL | type Size: Add<Output = Self::Size>;
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Encoder::Size`
```
r? @oli-obk
…-assoc-item, r=oli-obk label the path segment that is not an associated item of the trait E0782 pointed only at the trait, leaving the segment that actually failed to resolve unmarked unless it was close enough to suggest a typo fix. rust-lang#136994 r? @oli-obk cc @fmease
…, r=Urgau Add a README in tests/rustdoc-html to explain what each folder content is for Follow-up of rust-lang#162906. r? @Urgau
Member
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 21, 2026
Rollup of 6 pull requests try-job: dist-various-1 try-job: test-various try-job: test-x86_64-gnu-aux try-job: test-x86_64-gnu-llvm-21-3 try-job: test-x86_64-msvc-1 try-job: test-aarch64-apple-1 try-job: test-aarch64-apple-2 try-job: test-x86_64-mingw-1 try-job: test-i686-msvc try-job: test-armhf-gnu
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 21, 2026
…uwer Rollup of 6 pull requests Successful merges: - #163083 (Remove `G` generic param from `Diag<'_, G>`) - #160679 (Staticlib rename internal symbols: add COFF support) - #162007 (Preserve parentheses in raw borrow suggestions) - #163057 (Use span context for enclosing item(s) of unmet bound) - #163070 (label the path segment that is not an associated item of the trait) - #163078 ( Add a README in tests/rustdoc-html to explain what each folder content is for)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 947db2c failed: CI. Failed job:
|
Contributor
|
This pull request was unapproved due to being closed. |
Contributor
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.
Successful merges:
Ggeneric param fromDiag<'_, G>#163083 (RemoveGgeneric param fromDiag<'_, G>)r? @ghost
Create a similar rollup