Skip to content

Commit cffdb46

Browse files
committed
Merge branch '0.4' of https://github.com/bluss/arrayvec
* '0.4' of https://github.com/bluss/arrayvec: 0.4.10 FIX: Remove unused Copy/Clone for MaybeUninit FIX: Use repr(C) MaybeUninit after discussion with RalfJung
2 parents 9fc6737 + 21661fa commit cffdb46

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "arrayvec"
3-
version = "0.4.9"
3+
version = "0.4.10"
44
authors = ["bluss"]
55
license = "MIT/Apache-2.0"
66

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ __ https://docs.rs/arrayvec
2222
Recent Changes (arrayvec)
2323
-------------------------
2424

25+
- 0.4.10
26+
27+
- Use ``repr(C)`` in the ``union`` version that was introduced in 0.4.9, to
28+
allay some soundness concerns.
29+
2530
- 0.4.9
2631

2732
- Use ``union`` in the implementation on when this is detected to be supported

src/maybe_uninit.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,13 @@ use std::mem::ManuallyDrop;
66
/// A combination of ManuallyDrop and “maybe uninitialized”;
77
/// this wraps a value that can be wholly or partially uninitialized;
88
/// it also has no drop regardless of the type of T.
9-
#[derive(Copy)]
9+
#[repr(C)] // for cast from self ptr to value
1010
pub union MaybeUninit<T> {
1111
empty: (),
1212
value: ManuallyDrop<T>,
1313
}
1414
// Why we don't use std's MaybeUninit on nightly? See the ptr method
1515

16-
impl<T> Clone for MaybeUninit<T> where T: Copy
17-
{
18-
fn clone(&self) -> Self { *self }
19-
}
20-
2116
impl<T> MaybeUninit<T> {
2217
/// Create a new MaybeUninit with uninitialized interior
2318
pub unsafe fn uninitialized() -> Self {

0 commit comments

Comments
 (0)