Skip to content

Conversation

DiuDiu777
Copy link
Contributor

Description:

This PR addresses missing document regarding consistency of Box::from_raw and Box::from_raw_in.

  • from_raw: The document now misses the raw pointer passed to Box::from_raw must point to a block of memory allocated by the Global Allocator (specified in source code).

  • from_raw_in: The safety conditions don't include the allocator consistency.

Besides, Boxed Memory Layout doesn't explicitly cover the allocator consistency issue.

This change builds upon the improvements made in PR #134496.

@rustbot
Copy link
Collaborator

rustbot commented Jan 2, 2025

r? @jhpratt

rustbot has assigned @jhpratt.
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 Jan 2, 2025
@jhpratt
Copy link
Member

jhpratt commented Jan 2, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jan 2, 2025

📌 Commit a5494a8 has been approved by jhpratt

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 Jan 2, 2025
@bors
Copy link
Collaborator

bors commented Jan 2, 2025

⌛ Testing commit a5494a8 with merge bf6f8a4...

@bors
Copy link
Collaborator

bors commented Jan 2, 2025

☀️ Test successful - checks-actions
Approved by: jhpratt
Pushing bf6f8a4 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 2, 2025
@bors bors merged commit bf6f8a4 into rust-lang:master Jan 2, 2025
7 checks passed
@rustbot rustbot added this to the 1.85.0 milestone Jan 2, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bf6f8a4): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary 2.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.4% [1.9%, 2.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (primary 2.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.4% [2.4%, 2.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.4% [2.4%, 2.4%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 763.985s -> 763.526s (-0.06%)
Artifact size: 325.58 MiB -> 325.58 MiB (-0.00%)

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 28, 2025
Add missing allocator safety in alloc crate

### PR Description
In the previous PR [rust-lang#135009](rust-lang#135009), PR [rust-lang#134496](rust-lang#134496), some incomplete API documentation issues have been fixed.

Based on these changes,  other inconsistencies related to the allocator have also been identified, including:

- `Box::from_non_null`
- `Box::from_non_null_in`
- `Weak::from_raw`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 28, 2025
Add missing allocator safety in alloc crate

### PR Description
In the previous PR [rust-lang#135009](rust-lang#135009), PR [rust-lang#134496](rust-lang#134496), some incomplete API documentation issues have been fixed.

Based on these changes,  other inconsistencies related to the allocator have also been identified, including:

- `Box::from_non_null`
- `Box::from_non_null_in`
- `Weak::from_raw`
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 28, 2025
Rollup merge of rust-lang#135805 - DiuDiu777:master, r=Noratrieb

Add missing allocator safety in alloc crate

### PR Description
In the previous PR [rust-lang#135009](rust-lang#135009), PR [rust-lang#134496](rust-lang#134496), some incomplete API documentation issues have been fixed.

Based on these changes,  other inconsistencies related to the allocator have also been identified, including:

- `Box::from_non_null`
- `Box::from_non_null_in`
- `Weak::from_raw`
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jan 29, 2025
Add missing allocator safety in alloc crate

### PR Description
In the previous PR [#135009](rust-lang/rust#135009), PR [#134496](rust-lang/rust#134496), some incomplete API documentation issues have been fixed.

Based on these changes,  other inconsistencies related to the allocator have also been identified, including:

- `Box::from_non_null`
- `Box::from_non_null_in`
- `Weak::from_raw`
@DiuDiu777 DiuDiu777 deleted the box-doc branch March 10, 2025 02:18
@DiuDiu777 DiuDiu777 restored the box-doc branch March 10, 2025 02:19
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this pull request Mar 11, 2025
Add missing allocator safety in alloc crate

### PR Description
In the previous PR [rust-lang#135009](rust-lang#135009), PR [rust-lang#134496](rust-lang#134496), some incomplete API documentation issues have been fixed.

Based on these changes,  other inconsistencies related to the allocator have also been identified, including:

- `Box::from_non_null`
- `Box::from_non_null_in`
- `Weak::from_raw`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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