Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax allocator requirements on some Rc/Arc APIs. #124981

Merged
merged 2 commits into from
May 12, 2024

Conversation

zachs18
Copy link
Contributor

@zachs18 zachs18 commented May 10, 2024

Split out from #119761

  • Remove A: Clone bound from Rc::assume_init(s), Rc::downcast, and Rc::downcast_unchecked (Arc methods were already relaxed by Fix some Arc allocator leaks #120445)
  • Make From<Rc<[T; N]>> for Rc<[T]> allocator-aware (Arc's already is).
  • Remove A: Clone from Rc/Arc::unwrap_or_clone

Internal changes:

  • Made Arc::internal_into_inner_with_allocator method into Arc::into_inner_with_allocator associated fn.
  • Add private Rc::into_inner_with_allocator (to match Arc), so other fns don't have to juggle ManuallyDrop.

* Remove A: Clone bound from Rc::assume_init, Rc::downcast, and Rc::downcast_unchecked.
* Make From<Rc<[T; N]>> for Rc<[T]> allocator-aware.

Internal changes:

* Made Arc::internal_into_inner_with_allocator method into Arc::into_inner_with_allocator associated fn.
* Add private Rc::into_inner_with_allocator (to match Arc), so other fns don't have to juggle ManuallyDrop.
@rustbot
Copy link
Collaborator

rustbot commented May 10, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 10, 2024
@zachs18 zachs18 changed the title Relax allocator requirements on some Rc APIs. Relax allocator requirements on some Rc/Arc APIs. May 10, 2024
@rust-log-analyzer

This comment has been minimized.

@zachs18 zachs18 force-pushed the rc-allocator-generalize-1 branch from 06beef4 to 8d8eb50 Compare May 10, 2024 19:34
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 11, 2024

📌 Commit 8d8eb50 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors 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 May 11, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 11, 2024
… r=Mark-Simulacrum

Relax allocator requirements on some Rc/Arc APIs.

Split out from rust-lang#119761

* Remove `A: Clone` bound from `Rc::assume_init`(s), `Rc::downcast`, and `Rc::downcast_unchecked` (`Arc` methods were already relaxed by rust-lang#120445)
* Make `From<Rc<[T; N]>> for Rc<[T]>` allocator-aware (`Arc`'s already is).
* Remove `A: Clone` from `Rc/Arc::unwrap_or_clone`

Internal changes:

* Made `Arc::internal_into_inner_with_allocator` method into `Arc::into_inner_with_allocator` associated fn.
* Add private `Rc::into_inner_with_allocator` (to match Arc), so other fns don't have to juggle `ManuallyDrop`.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 11, 2024
… r=Mark-Simulacrum

Relax allocator requirements on some Rc/Arc APIs.

Split out from rust-lang#119761

* Remove `A: Clone` bound from `Rc::assume_init`(s), `Rc::downcast`, and `Rc::downcast_unchecked` (`Arc` methods were already relaxed by rust-lang#120445)
* Make `From<Rc<[T; N]>> for Rc<[T]>` allocator-aware (`Arc`'s already is).
* Remove `A: Clone` from `Rc/Arc::unwrap_or_clone`

Internal changes:

* Made `Arc::internal_into_inner_with_allocator` method into `Arc::into_inner_with_allocator` associated fn.
* Add private `Rc::into_inner_with_allocator` (to match Arc), so other fns don't have to juggle `ManuallyDrop`.
bors added a commit to rust-lang-ci/rust that referenced this pull request May 11, 2024
…llaumeGomez

Rollup of 6 pull requests

Successful merges:

 - rust-lang#124807 (Migrate `run-make/rustdoc-io-error` to `rmake.rs`)
 - rust-lang#124829 (Enable profiler for armv7-unknown-linux-gnueabihf.)
 - rust-lang#124939 (Always hide private fields in aliased type)
 - rust-lang#124963 (Migrate `run-make/rustdoc-shared-flags` to rmake)
 - rust-lang#124981 (Relax allocator requirements on some Rc/Arc APIs.)
 - rust-lang#125008 (Add test for rust-lang#122775)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request May 11, 2024
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#124096 (Clean up users of rust_dbg_call)
 - rust-lang#124829 (Enable profiler for armv7-unknown-linux-gnueabihf.)
 - rust-lang#124939 (Always hide private fields in aliased type)
 - rust-lang#124963 (Migrate `run-make/rustdoc-shared-flags` to rmake)
 - rust-lang#124981 (Relax allocator requirements on some Rc/Arc APIs.)
 - rust-lang#125008 (Add test for rust-lang#122775)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e3fca20 into rust-lang:master May 12, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 12, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 12, 2024
Rollup merge of rust-lang#124981 - zachs18:rc-allocator-generalize-1, r=Mark-Simulacrum

Relax allocator requirements on some Rc/Arc APIs.

Split out from rust-lang#119761

* Remove `A: Clone` bound from `Rc::assume_init`(s), `Rc::downcast`, and `Rc::downcast_unchecked` (`Arc` methods were already relaxed by rust-lang#120445)
* Make `From<Rc<[T; N]>> for Rc<[T]>` allocator-aware (`Arc`'s already is).
* Remove `A: Clone` from `Rc/Arc::unwrap_or_clone`

Internal changes:

* Made `Arc::internal_into_inner_with_allocator` method into `Arc::into_inner_with_allocator` associated fn.
* Add private `Rc::into_inner_with_allocator` (to match Arc), so other fns don't have to juggle `ManuallyDrop`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants