Skip to content

Commit 58c88f2

Browse files
committed
Auto merge of #95711 - Dylan-DPC:rollup-ujss3oi, r=Dylan-DPC
Rollup of 4 pull requests Successful merges: - #95659 (Rely on #[link] attribute for unwind on Fuchsia.) - #95684 (rustdoc: Fix item info display overflow) - #95693 (interp: pass TyCtxt to Machine methods that do not take InterpCx) - #95699 (fix: Vec leak when capacity is 0) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 6bad81a + fafe90f commit 58c88f2

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

alloc/src/raw_vec.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ impl<T, A: Allocator> RawVec<T, A> {
168168

169169
#[cfg(not(no_global_oom_handling))]
170170
fn allocate_in(capacity: usize, init: AllocInit, alloc: A) -> Self {
171-
if mem::size_of::<T>() == 0 {
171+
// Don't allocate here because `Drop` will not deallocate when `capacity` is 0.
172+
if mem::size_of::<T>() == 0 || capacity == 0 {
172173
Self::new_in(alloc)
173174
} else {
174175
// We avoid `unwrap_or_else` here because it bloats the amount of

unwind/build.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ fn main() {
4040
// This is handled in the target spec with late_link_args_[static|dynamic]
4141
} else if target.contains("uwp-windows-gnu") {
4242
println!("cargo:rustc-link-lib=unwind");
43-
} else if target.contains("fuchsia") {
44-
println!("cargo:rustc-link-lib=unwind");
4543
} else if target.contains("haiku") {
4644
println!("cargo:rustc-link-lib=gcc_s");
4745
} else if target.contains("redox") {

0 commit comments

Comments
 (0)