Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Rust

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "containers"
version = "0.9.11"
version = "0.9.12"
authors = ["M Farkas-Dyck <strake888@gmail.com>"]
description = "Containers"
license = "MIT OR Apache-2.0"
Expand All @@ -9,6 +9,7 @@ documentation = "https://docs.rs/containers/"
edition = "2018"

[dependencies]
abort = "0.1.3"
alloc = { package = "loca", version = "0.7" }
default_allocator = { version = "0.3", optional = true }
either = { version = "1.4", default-features = false }
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

#![deny(missing_debug_implementations)]

#![feature(non_ascii_idents)]
#![feature(coerce_unsized)]
#![feature(core_intrinsics)]
#![feature(const_fn)]
#![feature(const_fn_trait_bound)]
#![feature(const_mut_refs)]
#![feature(dropck_eyepatch)]
#![feature(unsize)]
Expand Down
5 changes: 3 additions & 2 deletions src/rc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use core::{cell::Cell, fmt, marker::Unsize, ops::{CoerceUnsized, Deref}, ptr::{self, NonNull}};
use abort::abort;
use alloc::{Alloc, Layout};
use core::{cell::Cell, fmt, marker::Unsize, ops::{CoerceUnsized, Deref}, ptr::{self, NonNull}};

use crate::boxed::Box;

Expand Down Expand Up @@ -72,7 +73,7 @@ impl<T: ?Sized, A: Alloc + Clone> Clone for Rc<T, A> {
const MAX_REFCOUNT: usize = isize::max_value() as _;
let old_size = self.inner().strong.get();
self.inner().strong.set(old_size + 1);
if old_size > MAX_REFCOUNT { ::core::intrinsics::abort() }
if old_size > MAX_REFCOUNT { abort() }
Self { ptr: self.ptr, alloc: self.alloc.clone() }
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/sync.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use abort::abort;
use alloc::{Alloc, Layout};
use core::{fmt, marker::Unsize, mem, ptr};
use core::ops::{Deref, CoerceUnsized};
Expand Down Expand Up @@ -77,7 +78,7 @@ impl<T: ?Sized, A: Alloc> Deref for Arc<T, A> {
impl<T: ?Sized, A: Alloc + Clone> Clone for Arc<T, A> {
#[inline]
fn clone(&self) -> Self {
if self.inner().strong.fetch_add(1, Memord::Relaxed) > ::core::isize::MAX as _ { ::core::intrinsics::abort() }
if self.inner().strong.fetch_add(1, Memord::Relaxed) > ::core::isize::MAX as _ { abort() }
Self { ptr: self.ptr, alloc: self.alloc.clone() }
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/util/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use abort::abort;
use core::mem;
use core::ptr;

Expand Down Expand Up @@ -35,7 +36,7 @@ struct AbortOnDrop;

impl Drop for AbortOnDrop {
#[inline(always)]
fn drop(&mut self) { ::core::intrinsics::abort() }
fn drop(&mut self) { abort() }
}

#[inline(always)]
Expand Down