From a5b61f9988c3a5e00a94084747991c9e4fc5f710 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Tue, 9 Nov 2021 20:25:23 +0100 Subject: [PATCH] Fix building on Rust 1.34 with `alloc` feature enabled (#154) * CI: Build Rust 1.34 with features * Fix building on Rust 1.34 with alloc feature enabled * CI: Fix building with features --- .github/workflows/rust.yml | 10 +++++++++- src/tinyvec.rs | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cedec04..b05d26e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,6 +11,7 @@ jobs: matrix: rust: - 1.34.0 + - 1.36.0 - stable - beta - nightly @@ -25,9 +26,16 @@ jobs: uses: actions-rs/cargo@v1 with: command: build - - name: Test on Stable/Beta + - name: Build the crate on 1.36 with features. if: matrix.rust != '1.34.0' uses: actions-rs/cargo@v1 + with: + command: build + # Using `extern crate alloc` is only possible after 1.36 + args: --features=alloc,std,grab_spare_slice + - name: Test on Stable/Beta + if: matrix.rust != '1.34.0' && matrix.rust != '1.36.0' + uses: actions-rs/cargo@v1 with: command: test args: --features=alloc --features=grab_spare_slice --features=rustc_1_40 diff --git a/src/tinyvec.rs b/src/tinyvec.rs index 11bf9df..3f1dc03 100644 --- a/src/tinyvec.rs +++ b/src/tinyvec.rs @@ -107,8 +107,8 @@ where #[inline] fn clone(&self) -> Self { match self { - Self::Heap(v) => Self::Heap(v.clone()), - Self::Inline(v) => Self::Inline(v.clone()), + TinyVec::Heap(v) => TinyVec::Heap(v.clone()), + TinyVec::Inline(v) => TinyVec::Inline(v.clone()), } }