Skip to content

Commit f689edf

Browse files
committed
Auto merge of rust-lang#82654 - JohnTitor:rollup-nkcdkzp, r=JohnTitor
Rollup of 10 pull requests Successful merges: - rust-lang#82309 (Propagate RUSTDOCFLAGS in the environment when documenting) - rust-lang#82403 (rustbuild: print out env vars on verbose rustc invocations) - rust-lang#82507 (Rename the `tidy` binary to `rust-tidy`) - rust-lang#82531 (Add GUI tests) - rust-lang#82532 (Add `build.print_step_rusage` to config.toml) - rust-lang#82543 (fix env var name in CI) - rust-lang#82622 (Propagate `--test-args` for `x.py test src/tools/cargo`) - rust-lang#82628 (Try to clarify GlobalAlloc::realloc documentation comment.) - rust-lang#82630 (Fix a typo in the `find_anon_type` doc) - rust-lang#82643 (Add more proc-macro attribute tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 5dd5702 + 7340465 commit f689edf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/src/alloc/global.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ pub unsafe trait GlobalAlloc {
122122
/// this allocator,
123123
///
124124
/// * `layout` must be the same layout that was used
125-
/// to allocate that block of memory,
125+
/// to allocate that block of memory.
126126
#[stable(feature = "global_alloc", since = "1.28.0")]
127127
unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout);
128128

@@ -167,7 +167,10 @@ pub unsafe trait GlobalAlloc {
167167
/// and should be considered unusable (unless of course it was
168168
/// transferred back to the caller again via the return value of
169169
/// this method). The new memory block is allocated with `layout`, but
170-
/// with the `size` updated to `new_size`.
170+
/// with the `size` updated to `new_size`. This new layout should be
171+
/// used when deallocating the new memory block with `dealloc`. The range
172+
/// `0..min(layout.size(), new_size)` of the new memory block is
173+
/// guaranteed to have the same values as the original block.
171174
///
172175
/// If this method returns null, then ownership of the memory
173176
/// block has not been transferred to this allocator, and the

0 commit comments

Comments
 (0)