diff options
| author | Tim Diekmann <21277928+TimDiekmann@users.noreply.github.com> | 2020-08-20 01:01:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-20 01:01:46 +0200 |
| commit | 303ee3fd8382947d0da7a728c728bc672dc0f7be (patch) | |
| tree | e449d80e65796620a3448a8d3ecdde6f8fcc2a84 | |
| parent | 438c40efa109d7a4d83efa066c19cb95dad9ed94 (diff) | |
| download | rust-303ee3fd8382947d0da7a728c728bc672dc0f7be.tar.gz rust-303ee3fd8382947d0da7a728c728bc672dc0f7be.zip | |
Add debug assertion for equal alignment in RawVec
| -rw-r--r-- | library/alloc/src/raw_vec.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/library/alloc/src/raw_vec.rs b/library/alloc/src/raw_vec.rs index e00cb361c00..dafbb0acd11 100644 --- a/library/alloc/src/raw_vec.rs +++ b/library/alloc/src/raw_vec.rs @@ -494,6 +494,7 @@ where alloc_guard(new_layout.size())?; let memory = if let Some((ptr, old_layout)) = current_memory { + debug_assert_eq!(old_layout.align(), new_layout.align()); unsafe { alloc.grow(ptr, old_layout, new_layout) } } else { alloc.alloc(new_layout) |
