We need at least rustc 1.28 to use repr transparent.

This commit is contained in:
Lokathor
2020-01-06 20:36:21 -07:00
parent 2363109401
commit 25371ac141
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -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
View File
@@ -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