mirror of
https://github.com/openharmony/third_party_rust_tinyvec.git
synced 2026-07-18 12:25:35 -04:00
We need at least rustc 1.28 to use repr transparent.
This commit is contained in:
@@ -11,6 +11,10 @@ categories = ["data-structures", "no-std"]
|
||||
[dependencies]
|
||||
# not even std!
|
||||
|
||||
[features]
|
||||
default = []
|
||||
rustc_28 = []
|
||||
|
||||
[badges]
|
||||
appveyor = { repository = "Lokathor/tinyvec" }
|
||||
travis-ci = { repository = "Lokathor/tinyvec" }
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ enum Payload<T: Default> {
|
||||
/// A `TinyVec<T>` is like a `Vec<T>`, but it will store up to 8 elements
|
||||
/// "inline" on the stack before transitioning into being a normal `Vec<T>`.
|
||||
#[derive(Debug, Clone)]
|
||||
#[repr(transparent)]
|
||||
#[cfg_attr(feature = "rustc_28", repr(transparent))]
|
||||
pub struct TinyVec<T: Default>(Payload<T>);
|
||||
|
||||
// TODO: impl a better Debug
|
||||
|
||||
Reference in New Issue
Block a user