Skip to content

Custom allocator support in rustc_serialize - #99920

Merged
bors merged 1 commit into
rust-lang:masterfrom
emarteca:custom-allocator-support
Aug 26, 2022
Merged

Custom allocator support in rustc_serialize#99920
bors merged 1 commit into
rust-lang:masterfrom
emarteca:custom-allocator-support

Conversation

@emarteca

@emartecaemarteca commented Jul 29, 2022

Copy link
Copy Markdown

Adding support for rustc_serialize encode/decode for Box and Vec that use a custom allocator.

@rustbotrustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 29, 2022
@rust-highfive

Copy link
Copy Markdown
Contributor

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.

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 29, 2022
Comment threadcompiler/rustc_serialize/src/serialize.rs Outdated
@oli-obk

Copy link
Copy Markdown
Contributor

Please rebase over the latest master branch and squash the commits

@emarteca
emartecaforce-pushed the custom-allocator-support branch from e97f121 to e571d52CompareAugust 24, 2022 20:44
@rustbotrustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-rustdoc-json Area: Rustdoc JSON backend A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Aug 24, 2022
@rustbot

Copy link
Copy Markdown
Collaborator

rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing src/librustdoc/json/conversions.rs; otherwise, make sure you bump the FORMAT_VERSION constant.

cc @CraftSpider, @aDotInTheVoid, @Enselic

Changes rustc_apfloat. rustc_apfloat is currently in limbo and you almost certainly don't want to change it (see #55993).

cc @eddyb

Some changes occurred in library/proc_macro/src/bridge

cc @rust-lang/wg-rls-2

Some changes occurred in src/tools/cargo

cc @ehuss

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo

rustc_macros::diagnostics was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

This PR changes MIR

cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras

The Miri submodule was changed

cc @rust-lang/miri

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

rustc_errors::translation was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred in HTML/CSS themes.

cc @GuillaumeGomez

A change occurred in the Ayu theme.

cc @Cldfire

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

Some changes occurred to the CTFE / Miri engine

cc @rust-lang/miri

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@compiler-errors

Copy link
Copy Markdown
Contributor

Uh, I don't think this was rebased corectly.

@emarteca

Copy link
Copy Markdown
Author

Uh, I don't think this was rebased corectly.

Yeah my mistake, fixed now 😰

@compiler-errors

Copy link
Copy Markdown
Contributor

Much better!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: missing trailing newline

@rust-log-analyzer

This comment has been minimized.

@RalfJung

Copy link
Copy Markdown
Member

Rationale: as part of rust-lang/miri#2365 I'm planning to extend the Allocation struct to be able to use a custom allocator (specifically, to allocate the bytes field).

This doesn't even reflect the current plan any more I think?

With the approach I proposed, I don't think we need this PR.

@emarteca

Copy link
Copy Markdown
Author

With the approach I proposed, I don't think we need this PR.

That's true. But should we keep it anyway, in case someone else wants to serialize a Box or Vec with a custom allocator?

@oli-obk

Copy link
Copy Markdown
Contributor

But should we keep it anyway, in case someone else wants to serialize a Box or Vec with a custom allocator?

yea, this change seems good on its own. I removed the rationale comment from the main post so it doesn't end up in git history.

@bors r+ rollup

@bors

bors commented Aug 25, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit d5c90d23a5acd36753ddef0c28437b756551701a has been approved by oli-obk

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 25, 2022
@klensy

Copy link
Copy Markdown
Contributor

Probably you want to rebase/squash again, bc if you click on first commit, it shows weird things: e571d52

@oli-obk

Copy link
Copy Markdown
Contributor

@bors r-

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 25, 2022
@emarteca
emartecaforce-pushed the custom-allocator-support branch from 5d7ad36 to 258d367CompareAugust 25, 2022 20:21
@emarteca
emarteca requested a review from oli-obkAugust 25, 2022 20:25
@oli-obk

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Aug 25, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 258d367 has been approved by oli-obk

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 25, 2022
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Aug 25, 2022
…r=oli-obk
Custom allocator support in `rustc_serialize`
Adding support for `rustc_serialize` encode/decode for `Box` and `Vec` that use a custom allocator.
@JohnTitorJohnTitor mentioned this pull request Aug 25, 2022
@JohnTitorJohnTitor mentioned this pull request Aug 26, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 26, 2022
Rollup of 8 pull requests
Successful merges:
- rust-lang#99064 (distinguish the method and associated function diagnostic information)
- rust-lang#99920 (Custom allocator support in `rustc_serialize`)
- rust-lang#100034 ( Elaborate all box dereferences in `ElaborateBoxDerefs`)
- rust-lang#100076 (make slice::{split_at,split_at_unchecked} const functions)
- rust-lang#100604 (Remove unstable Result::into_ok_or_err)
- rust-lang#100933 (Reduce code size of `assert_matches_failed`)
- rust-lang#100978 (Handle `Err` in `ast::LitKind::to_token_lit`.)
- rust-lang#101010 (rustdoc: remove unused CSS for `.multi-column`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 28457e1 into rust-lang:masterAug 26, 2022
@rustbotrustbot added this to the 1.65.0 milestone Aug 26, 2022
@aDotInTheVoidaDotInTheVoid removed T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-rustdoc-json Area: Rustdoc JSON backend A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic labels Dec 27, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

11 participants

@emarteca@rust-highfive@oli-obk@rustbot@compiler-errors@rust-log-analyzer@RalfJung@bors@klensy@bjorn3@aDotInTheVoid