Skip to content

Commit f529e5d

Browse files
committed
Fix placement of requires clause
1 parent f685389 commit f529e5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/alloc/src/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ pub unsafe fn alloc_zeroed(layout: Layout) -> *mut u8 {
177177

178178
#[cfg(not(test))]
179179
impl Global {
180+
#[requires(layout.size() == 0 || layout.align() != 0)]
180181
#[inline]
181182
fn alloc_impl(&self, layout: Layout, zeroed: bool) -> Result<NonNull<[u8]>, AllocError> {
182-
#[requires(layout.size() == 0 || layout.align() != 0)]
183183
match layout.size() {
184184
0 => Ok(NonNull::slice_from_raw_parts(layout.dangling(), 0)),
185185
// SAFETY: `layout` is non-zero in size,

0 commit comments

Comments
 (0)