| { | ||
| "git": { | ||
| "sha1": "67ec907a98c0f40c4b76066fed3c1af59d35cf6a" | ||
| "sha1": "4ab6d63958e7c1892c6ed5113a26fab52fbb0efe" | ||
| }, | ||
| "path_in_vcs": "" | ||
| } |
@@ -54,4 +54,8 @@ on: | ||
| - uses: actions/checkout@v2 | ||
| - name: Miri | ||
| run: ci/miri.sh | ||
| - name: Install Miri | ||
| run: | | ||
| rustup toolchain install nightly --component miri | ||
| rustup override set nightly | ||
| cargo miri setup | ||
| - name: Test with Miri | ||
| run: cargo miri test |
+19
-5
@@ -15,10 +15,21 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| name = "arrayvec" | ||
| version = "0.7.2" | ||
| version = "0.7.3" | ||
| authors = ["bluss"] | ||
| description = "A vector with fixed capacity, backed by an array (it can be stored on the stack too). Implements fixed capacity ArrayVec and ArrayString." | ||
| documentation = "https://docs.rs/arrayvec/" | ||
| keywords = ["stack", "vector", "array", "data-structure", "no_std"] | ||
| categories = ["data-structures", "no-std"] | ||
| readme = "README.md" | ||
| keywords = [ | ||
| "stack", | ||
| "vector", | ||
| "array", | ||
| "data-structure", | ||
| "no_std", | ||
| ] | ||
| categories = [ | ||
| "data-structures", | ||
| "no-std", | ||
| ] | ||
| license = "MIT OR Apache-2.0" | ||
| repository = "https://github.com/bluss/arrayvec" | ||
| [package.metadata.docs.rs] | ||
@@ -30,7 +41,8 @@ features = ["serde"] | ||
| tag-name = "{{version}}" | ||
| [profile.bench] | ||
| debug = true | ||
| debug = 2 | ||
| [profile.release] | ||
| debug = true | ||
| debug = 2 | ||
@@ -44,2 +56,3 @@ [[bench]] | ||
| harness = false | ||
| [dependencies.serde] | ||
@@ -49,2 +62,3 @@ version = "1.0" | ||
| default-features = false | ||
| [dev-dependencies.bencher] | ||
@@ -51,0 +65,0 @@ version = "0.1.4" |
+8
-0
| Recent Changes (arrayvec) | ||
| ========================= | ||
| ## 0.7.3 | ||
| - Use track_caller on multiple methods like push and similar, for capacity | ||
| overflows by @kornelski | ||
| - impl BorrowMut for ArrayString by @msrd0 | ||
| - Fix stacked borrows violations by @clubby789 | ||
| - Update Miri CI by @RalfJung | ||
| ## 0.7.2 | ||
@@ -5,0 +13,0 @@ |
+13
-4
@@ -1,2 +0,2 @@ | ||
| use std::borrow::Borrow; | ||
| use std::borrow::{Borrow, BorrowMut}; | ||
| use std::cmp; | ||
@@ -204,2 +204,3 @@ use std::convert::TryFrom; | ||
| /// ``` | ||
| #[track_caller] | ||
| pub fn push(&mut self, c: char) { | ||
@@ -256,2 +257,3 @@ self.try_push(c).unwrap(); | ||
| /// ``` | ||
| #[track_caller] | ||
| pub fn push_str(&mut self, s: &str) { | ||
@@ -376,6 +378,8 @@ self.try_push_str(s).unwrap() | ||
| let len = self.len(); | ||
| let ptr = self.as_mut_ptr(); | ||
| unsafe { | ||
| ptr::copy(self.as_ptr().add(next), | ||
| self.as_mut_ptr().add(idx), | ||
| len - next); | ||
| ptr::copy( | ||
| ptr.add(next), | ||
| ptr.add(idx), | ||
| len - next); | ||
| self.set_len(len - (next - idx)); | ||
@@ -485,2 +489,7 @@ } | ||
| impl<const CAP: usize> BorrowMut<str> for ArrayString<CAP> | ||
| { | ||
| fn borrow_mut(&mut self) -> &mut str { self } | ||
| } | ||
| impl<const CAP: usize> AsRef<str> for ArrayString<CAP> | ||
@@ -487,0 +496,0 @@ { |
@@ -38,2 +38,3 @@ use std::ptr; | ||
| #[track_caller] | ||
| fn push(&mut self, element: Self::Item) { | ||
@@ -40,0 +41,0 @@ self.try_push(element).unwrap() |
+12
-5
@@ -80,2 +80,4 @@ | ||
| /// ``` | ||
| #[inline] | ||
| #[track_caller] | ||
| pub fn new() -> ArrayVec<T, CAP> { | ||
@@ -176,2 +178,3 @@ assert_capacity_limit!(CAP); | ||
| /// ``` | ||
| #[track_caller] | ||
| pub fn push(&mut self, element: T) { | ||
@@ -282,2 +285,3 @@ ArrayVecImpl::push(self, element) | ||
| /// ``` | ||
| #[track_caller] | ||
| pub fn insert(&mut self, index: usize, element: T) { | ||
@@ -513,3 +517,3 @@ self.try_insert(index, element).unwrap() | ||
| unsafe { | ||
| let hole_slot = g.v.as_mut_ptr().add(g.processed_len - g.deleted_cnt); | ||
| let hole_slot = cur.sub(g.deleted_cnt); | ||
| ptr::copy_nonoverlapping(cur, hole_slot, 1); | ||
@@ -755,2 +759,3 @@ } | ||
| impl<T, const CAP: usize> From<[T; CAP]> for ArrayVec<T, CAP> { | ||
| #[track_caller] | ||
| fn from(array: [T; CAP]) -> Self { | ||
@@ -986,5 +991,4 @@ let array = ManuallyDrop::new(array); | ||
| let tail = self.tail_start; | ||
| let src = source_vec.as_ptr().add(tail); | ||
| let dst = source_vec.as_mut_ptr().add(start); | ||
| ptr::copy(src, dst, self.tail_len); | ||
| let ptr = source_vec.as_mut_ptr(); | ||
| ptr::copy(ptr.add(tail), ptr.add(start), self.tail_len); | ||
| source_vec.set_len(start + self.tail_len); | ||
@@ -1021,2 +1025,3 @@ } | ||
| /// ***Panics*** if extending the vector exceeds its capacity. | ||
| #[track_caller] | ||
| fn extend<I: IntoIterator<Item=T>>(&mut self, iter: I) { | ||
@@ -1031,2 +1036,3 @@ unsafe { | ||
| #[cold] | ||
| #[track_caller] | ||
| fn extend_panic() { | ||
@@ -1043,2 +1049,3 @@ panic!("ArrayVec: capacity exceeded in extend/from_iter"); | ||
| /// The caller must ensure the length of the input fits in the capacity. | ||
| #[track_caller] | ||
| pub(crate) unsafe fn extend_from_iter<I, const CHECK: bool>(&mut self, iterable: I) | ||
@@ -1094,3 +1101,3 @@ where I: IntoIterator<Item = T> | ||
| // Special case for ZST | ||
| (ptr as usize).wrapping_add(offset) as _ | ||
| ptr.cast::<u8>().wrapping_add(offset).cast() | ||
| } else { | ||
@@ -1097,0 +1104,0 @@ ptr.add(offset) |
-15
| #!/bin/sh | ||
| set -ex | ||
| export CARGO_NET_RETRY=5 | ||
| export CARGO_NET_TIMEOUT=10 | ||
| MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri) | ||
| echo "Installing latest nightly with Miri: $MIRI_NIGHTLY" | ||
| rustup default "$MIRI_NIGHTLY" | ||
| rustup component add miri | ||
| cargo miri setup | ||
| cargo miri test |
Sorry, the diff of this file is not supported yet