FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Implement a stop-gap “MaybeUninit” using ManuallyDrop by bluss · Pull Request #97 · bluss/arrayvec · GitHub

/ arrayvec Public
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rs  (5) .toml  (1) .yml  (1) All 3 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
32 changes: 13 additions & 19 deletions .travis.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,34 @@ env:
- FEATURES='serde-1'
matrix:
include:
- rust: 1.20.0
- rust: stable
env:
- NODEFAULT=1
- NODROP_FEATURES='use_needs_drop'
- rust: 1.22.1
env:
- FEATURES='array-sizes-33-128 array-sizes-129-255'
- rust: stable
- rust: stable
env:
- FEATURES='serde-1'
- rust: stable
env:
- FEATURES='array-sizes-33-128 array-sizes-129-255'
- rust: beta
- rust: nightly
env:
- NODEFAULT=1
- FEATURES='serde-1'
- rust: nightly
env:
- NODROP_FEATURES='use_needs_drop'
- FEATURES='serde-1'
- rust: nightly
env:
- FEATURES='serde use_union'
- NODROP_FEATURES='use_union'
- FEATURES='array-sizes-33-128 array-sizes-129-255'
branches:
only:
- master
- 0.3
script:
- |
([ ! -z "$NODROP_FEATURES" ] || cargo build --verbose --features "$FEATURES") &&
([ "$NODEFAULT" != 1 ] || cargo build --verbose --no-default-features) &&
([ ! -z "$NODROP_FEATURES" ] || cargo test --verbose --features "$FEATURES") &&
([ ! -z "$NODROP_FEATURES" ] || cargo test --release --verbose --features "$FEATURES") &&
([ ! -z "$NODROP_FEATURES" ] || cargo bench --verbose --features "$FEATURES" -- --test) &&
([ ! -z "$NODROP_FEATURES" ] || cargo doc --verbose --features "$FEATURES") &&
([ "$NODEFAULT" != 1 ] || cargo build --verbose --manifest-path=nodrop/Cargo.toml --no-default-features) &&
cargo test --verbose --manifest-path=nodrop/Cargo.toml --features "$NODROP_FEATURES" &&
cargo bench --verbose --manifest-path=nodrop/Cargo.toml --features "$NODROP_FEATURES" -- --test
cargo build --verbose --no-default-features &&
cargo build --verbose --features "$FEATURES" &&
cargo test --verbose --features "$FEATURES" &&
cargo test --release --verbose --features "$FEATURES" &&
cargo bench --verbose --features "$FEATURES" --no-run &&
cargo doc --verbose --features "$FEATURES"
7 changes: 5 additions & 2 deletions Cargo.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ repository = "https://github.com/bluss/arrayvec"
keywords = ["stack", "vector", "array", "data-structure", "no_std"]
categories = ["data-structures", "no-std"]

[build-dependencies]

[dependencies]
nodrop = { version = "0.1.12", path = "nodrop", default-features = false }

[dependencies.serde]
version = "1.0"
Expand All @@ -37,12 +38,14 @@ harness = false
[features]
default = ["std"]
std = []
use_union = []
serde-1 = ["serde"]

array-sizes-33-128 = []
array-sizes-129-255 = []

# has no effect
use_union = []

[package.metadata.docs.rs]
features = ["serde-1"]

Expand Down
10 changes: 4 additions & 6 deletions src/array.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
pub unsafe trait Array {
/// The array’s element type
type Item;
/// The smallest type that can index and tell the length of the array.
#[doc(hidden)]
/// The smallest index type that indexes the array.
type Index: Index;
/// The array's element capacity
const CAPACITY: usize;
#[doc(hidden)]
fn as_ptr(&self) -> *const Self::Item;
#[doc(hidden)]
fn as_mut_ptr(&mut self) -> *mut Self::Item;
#[doc(hidden)]
fn capacity() -> usize;
}

Expand Down Expand Up @@ -91,14 +91,12 @@ macro_rules! fix_array_impl {
unsafe impl<T> Array for [T; $len] {
type Item = T;
type Index = $index_type;
const CAPACITY: usize = $len;
#[doc(hidden)]
#[inline(always)]
fn as_ptr(&self) -> *const T { self as *const _ as *const _ }
#[doc(hidden)]
#[inline(always)]
fn as_mut_ptr(&mut self) -> *mut T { self as *mut _ as *mut _}
#[doc(hidden)]
#[inline(always)]
fn capacity() -> usize { $len }
}
)
Expand Down
Loading

Back | FazBrowse Home | New Git URL