mirror of
https://github.com/openharmony/third_party_rust_tinyvec.git
synced 2026-07-01 20:44:03 -04:00
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
This commit is contained in:
@@ -11,6 +11,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
rust:
|
rust:
|
||||||
- 1.34.0
|
- 1.34.0
|
||||||
|
- 1.36.0
|
||||||
- stable
|
- stable
|
||||||
- beta
|
- beta
|
||||||
- nightly
|
- nightly
|
||||||
@@ -25,9 +26,16 @@ jobs:
|
|||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: build
|
command: build
|
||||||
- name: Test on Stable/Beta
|
- name: Build the crate on 1.36 with features.
|
||||||
if: matrix.rust != '1.34.0'
|
if: matrix.rust != '1.34.0'
|
||||||
uses: actions-rs/cargo@v1
|
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:
|
with:
|
||||||
command: test
|
command: test
|
||||||
args: --features=alloc --features=grab_spare_slice --features=rustc_1_40
|
args: --features=alloc --features=grab_spare_slice --features=rustc_1_40
|
||||||
|
|||||||
+2
-2
@@ -107,8 +107,8 @@ where
|
|||||||
#[inline]
|
#[inline]
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
match self {
|
match self {
|
||||||
Self::Heap(v) => Self::Heap(v.clone()),
|
TinyVec::Heap(v) => TinyVec::Heap(v.clone()),
|
||||||
Self::Inline(v) => Self::Inline(v.clone()),
|
TinyVec::Inline(v) => TinyVec::Inline(v.clone()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user