diff --git a/Cargo.toml b/Cargo.toml index 77d29bc..e406e20 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } diff --git a/src/lib.rs b/src/lib.rs index 3ca3e0b..53e675f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,7 +23,7 @@ enum Payload { /// A `TinyVec` is like a `Vec`, but it will store up to 8 elements /// "inline" on the stack before transitioning into being a normal `Vec`. #[derive(Debug, Clone)] -#[repr(transparent)] +#[cfg_attr(feature = "rustc_28", repr(transparent))] pub struct TinyVec(Payload); // TODO: impl a better Debug