Rework #[cold] attribute parser#142491
Conversation
This comment has been minimized.
This comment has been minimized.
|
☔ The latest upstream changes (presumably #142589) made this pull request unmergeable. Please resolve the merge conflicts. |
3db6951 to
414d859
Compare
|
☔ The latest upstream changes (presumably #142697) made this pull request unmergeable. Please resolve the merge conflicts. |
|
rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing cc @CraftSpider, @aDotInTheVoid, @Enselic, @obi1kenobi Some changes occurred in compiler/rustc_codegen_ssa |
|
@aDotInTheVoid just another version bump of json because another attr changed. I'll consistently do that from now on until I'll fix it properly. I don't mind putting some time in to actually add it to rustdoc proper :) |
|
@bors r+ rollup |
Rollup of 9 pull requests Successful merges: - #142331 (Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types.) - #142491 (Rework #[cold] attribute parser) - #142494 (Fix missing docs in `rustc_attr_parsing`) - #142495 (Better template for `#[repr]` attributes) - #142497 (Fix random failure when JS code is executed when the whole file was not read yet) - #142575 (Ensure copy* intrinsics also perform the static self-init checks) - #142650 (Refactor Translator) - #142713 (mbe: Refactor transcription) - #142755 (rustdoc: Remove `FormatRenderer::cache`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - #142331 (Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types.) - #142491 (Rework #[cold] attribute parser) - #142494 (Fix missing docs in `rustc_attr_parsing`) - #142495 (Better template for `#[repr]` attributes) - #142497 (Fix random failure when JS code is executed when the whole file was not read yet) - #142575 (Ensure copy* intrinsics also perform the static self-init checks) - #142650 (Refactor Translator) - #142713 (mbe: Refactor transcription) - #142755 (rustdoc: Remove `FormatRenderer::cache`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #142491 - jdonszelmann:cold, r=oli-obk Rework #[cold] attribute parser r? `@oli-obk`
What's the issue with attr changes? It's odd to see |
|
Rustdoc JSON includes attributes as strings, and that string representation
is changing in these PRs from "the text you'd see in source code" to
something that looks like `Debug` output of a parsed struct.
This is the least-bad option until we have more specific guarantees about
which attributes have guaranteed representations, and which are best-effort
/ "other".
…On Fri, Jun 20, 2025, 11:55 PM Nicholas Nethercote ***@***.***> wrote:
*nnethercote* left a comment (rust-lang/rust#142491)
<#142491 (comment)>
@aDotInTheVoid <https://github.com/aDotInTheVoid> just another version
bump of json because another attr changed. I'll consistently do that from
now on until I'll fix it properly. I don't mind putting some time in to
actually add it to rustdoc proper :)
What's the issue with attr changes? It's odd to see FORMAT_VERSION change
without any other rustdoc code changing.
—
Reply to this email directly, view it on GitHub
<#142491 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR5MSWFWHCPMPPSLRLZ42T3ETJT3AVCNFSM6AAAAAB7JZ24AWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSOJTGMYDCMJVGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
@nnethercote effectively that's the problem. We discovered that attributes are put in rustdoc verbatim meaning no rustdoc code has to change and still it's a problem.... We will build a better solution, but I'm afraid it'll take a little bit. |
Rollup of 9 pull requests Successful merges: - rust-lang/rust#142331 (Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types.) - rust-lang/rust#142491 (Rework #[cold] attribute parser) - rust-lang/rust#142494 (Fix missing docs in `rustc_attr_parsing`) - rust-lang/rust#142495 (Better template for `#[repr]` attributes) - rust-lang/rust#142497 (Fix random failure when JS code is executed when the whole file was not read yet) - rust-lang/rust#142575 (Ensure copy* intrinsics also perform the static self-init checks) - rust-lang/rust#142650 (Refactor Translator) - rust-lang/rust#142713 (mbe: Refactor transcription) - rust-lang/rust#142755 (rustdoc: Remove `FormatRenderer::cache`) r? `@ghost` `@rustbot` modify labels: rollup
|
See #141358 for details of what a "better solution" means here, and aDotInTheVoid@9be4e00 for a very WIP implementation |
|
And #142936 for an implementation. |
…ou, r=GuillaumeGomez rustdoc-json: Add test for `#[cold]` Follow-up to rust-lang#142491 r? `@GuillaumeGomez` CC `@jdonszelmann`
Rollup of 9 pull requests Successful merges: - rust-lang/rust#142331 (Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types.) - rust-lang/rust#142491 (Rework #[cold] attribute parser) - rust-lang/rust#142494 (Fix missing docs in `rustc_attr_parsing`) - rust-lang/rust#142495 (Better template for `#[repr]` attributes) - rust-lang/rust#142497 (Fix random failure when JS code is executed when the whole file was not read yet) - rust-lang/rust#142575 (Ensure copy* intrinsics also perform the static self-init checks) - rust-lang/rust#142650 (Refactor Translator) - rust-lang/rust#142713 (mbe: Refactor transcription) - rust-lang/rust#142755 (rustdoc: Remove `FormatRenderer::cache`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - rust-lang#142331 (Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types.) - rust-lang#142491 (Rework #[cold] attribute parser) - rust-lang#142494 (Fix missing docs in `rustc_attr_parsing`) - rust-lang#142495 (Better template for `#[repr]` attributes) - rust-lang#142497 (Fix random failure when JS code is executed when the whole file was not read yet) - rust-lang#142575 (Ensure copy* intrinsics also perform the static self-init checks) - rust-lang#142650 (Refactor Translator) - rust-lang#142713 (mbe: Refactor transcription) - rust-lang#142755 (rustdoc: Remove `FormatRenderer::cache`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - rust-lang/rust#142331 (Add `trim_prefix` and `trim_suffix` methods for both `slice` and `str` types.) - rust-lang/rust#142491 (Rework #[cold] attribute parser) - rust-lang/rust#142494 (Fix missing docs in `rustc_attr_parsing`) - rust-lang/rust#142495 (Better template for `#[repr]` attributes) - rust-lang/rust#142497 (Fix random failure when JS code is executed when the whole file was not read yet) - rust-lang/rust#142575 (Ensure copy* intrinsics also perform the static self-init checks) - rust-lang/rust#142650 (Refactor Translator) - rust-lang/rust#142713 (mbe: Refactor transcription) - rust-lang/rust#142755 (rustdoc: Remove `FormatRenderer::cache`) r? `@ghost` `@rustbot` modify labels: rollup
r? @oli-obk