Skip to content

Commit 85f21c6

Browse files
Fix no std with alloc (#226)
* Fix compile for no_std users * Add regression test for no_std users with alloc on
1 parent 5f4240f commit 85f21c6

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/rust.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
if: matrix.rust == '1.60.0'
3232
run: |
3333
cargo check --features=alloc,std,grab_spare_slice
34+
- name: Check no_std with alloc
35+
if: matrix.rust != '1.60.0'
36+
run: |
37+
cargo check --no-default-features --features=alloc,grab_spare_slice,latest_stable_rust
3438
- name: Test non nightly
3539
if: matrix.rust != '1.60.0' && matrix.rust != 'nightly'
3640
run: |

src/tinyvec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ impl<A: Array> TinyVec<A> {
707707
if len <= A::CAPACITY {
708708
TinyVec::Inline(ArrayVec::from_array_len(A::default(), len))
709709
} else {
710-
TinyVec::Heap(vec![A::Item::default(); len])
710+
TinyVec::Heap(alloc::vec![A::Item::default(); len])
711711
}
712712
}
713713

0 commit comments

Comments
 (0)