Skip to content

Commit b2adcca

Browse files
committed
---
yaml --- r: 236429 b: refs/heads/auto c: 459f772 h: refs/heads/master i: 236427: 355f3b7 v: v3
1 parent bd43284 commit b2adcca

File tree

5 files changed

+33
-11
lines changed

5 files changed

+33
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 06812c29991d1b4bd43feef1deb4fb8ad0cf404f
11+
refs/heads/auto: 459f7720b99db16f3b9017820b1979698ba8c90b
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/liballoc/arc.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,9 @@ impl<T: ?Sized> Arc<T> {
307307

308308
if self.inner().weak.fetch_sub(1, Release) == 1 {
309309
atomic::fence(Acquire);
310-
deallocate(ptr as *mut u8, size_of_val(&*ptr), align_of_val(&*ptr))
310+
deallocate(ptr as *mut u8,
311+
size_of_val(&*ptr),
312+
align_of_val(&*ptr))
311313
}
312314
}
313315
}
@@ -719,7 +721,11 @@ impl<T: ?Sized> Drop for Weak<T> {
719721
// ref, which can only happen after the lock is released.
720722
if self.inner().weak.fetch_sub(1, Release) == 1 {
721723
atomic::fence(Acquire);
722-
unsafe { deallocate(ptr as *mut u8, size_of_val(&*ptr), align_of_val(&*ptr)) }
724+
unsafe {
725+
deallocate(ptr as *mut u8,
726+
size_of_val(&*ptr),
727+
align_of_val(&*ptr))
728+
}
723729
}
724730
}
725731
}

branches/auto/src/liballoc/heap.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ extern {
3434
#[inline(always)]
3535
fn check_size_and_alignment(size: usize, align: usize) {
3636
debug_assert!(size != 0);
37-
debug_assert!(size <= isize::MAX as usize, "Tried to allocate too much: {} bytes", size);
38-
debug_assert!(usize::is_power_of_two(align), "Invalid alignment of allocation: {}", align);
37+
debug_assert!(size <= isize::MAX as usize,
38+
"Tried to allocate too much: {} bytes",
39+
size);
40+
debug_assert!(usize::is_power_of_two(align),
41+
"Invalid alignment of allocation: {}",
42+
align);
3943
}
4044

4145
// FIXME: #13996: mark the `allocate` and `reallocate` return value as `noalias`

branches/auto/src/liballoc/raw_vec.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ impl<T> RawVec<T> {
274274
let ptr = if self.cap == 0 {
275275
heap::allocate(new_alloc_size, align)
276276
} else {
277-
heap::reallocate(self.ptr() as *mut _, self.cap * elem_size, new_alloc_size, align)
277+
heap::reallocate(self.ptr() as *mut _,
278+
self.cap * elem_size,
279+
new_alloc_size,
280+
align)
278281
};
279282

280283
// If allocate or reallocate fail, we'll get `null` back
@@ -358,7 +361,10 @@ impl<T> RawVec<T> {
358361
let ptr = if self.cap == 0 {
359362
heap::allocate(new_alloc_size, align)
360363
} else {
361-
heap::reallocate(self.ptr() as *mut _, self.cap * elem_size, new_alloc_size, align)
364+
heap::reallocate(self.ptr() as *mut _,
365+
self.cap * elem_size,
366+
new_alloc_size,
367+
align)
362368
};
363369

364370
// If allocate or reallocate fail, we'll get `null` back
@@ -392,7 +398,8 @@ impl<T> RawVec<T> {
392398
}
393399

394400
// This check is my waterloo; it's the only thing Vec wouldn't have to do.
395-
assert!(self.cap >= amount, "Tried to shrink to a larger capacity");
401+
assert!(self.cap >= amount,
402+
"Tried to shrink to a larger capacity");
396403

397404
if amount == 0 {
398405
mem::replace(self, RawVec::new());
@@ -466,6 +473,7 @@ impl<T> Drop for RawVec<T> {
466473
#[inline]
467474
fn alloc_guard(alloc_size: usize) {
468475
if core::usize::BITS < 64 {
469-
assert!(alloc_size <= ::core::isize::MAX as usize, "capacity overflow");
476+
assert!(alloc_size <= ::core::isize::MAX as usize,
477+
"capacity overflow");
470478
}
471479
}

branches/auto/src/liballoc/rc.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,9 @@ impl<T: ?Sized> Drop for Rc<T> {
466466
self.dec_weak();
467467

468468
if self.weak() == 0 {
469-
deallocate(ptr as *mut u8, size_of_val(&*ptr), align_of_val(&*ptr))
469+
deallocate(ptr as *mut u8,
470+
size_of_val(&*ptr),
471+
align_of_val(&*ptr))
470472
}
471473
}
472474
}
@@ -785,7 +787,9 @@ impl<T: ?Sized> Drop for Weak<T> {
785787
// the weak count starts at 1, and will only go to zero if all
786788
// the strong pointers have disappeared.
787789
if self.weak() == 0 {
788-
deallocate(ptr as *mut u8, size_of_val(&*ptr), align_of_val(&*ptr))
790+
deallocate(ptr as *mut u8,
791+
size_of_val(&*ptr),
792+
align_of_val(&*ptr))
789793
}
790794
}
791795
}

0 commit comments

Comments
 (0)