1
Fork 0

liballoc: cargo check passes on 2018

This commit is contained in:
Mazdak Farrokhzad 2019-02-02 08:36:45 +01:00
parent 5594b0d5b8
commit e6e27924e1
20 changed files with 61 additions and 60 deletions

View file

@ -6,8 +6,8 @@ use core::cmp::Ordering;
use core::hash::{Hash, Hasher}; use core::hash::{Hash, Hasher};
use core::ops::{Add, AddAssign, Deref}; use core::ops::{Add, AddAssign, Deref};
use fmt; use crate::fmt;
use string::String; use crate::string::String;
use self::Cow::*; use self::Cow::*;

View file

@ -73,9 +73,9 @@ use core::ops::{
use core::ptr::{self, NonNull, Unique}; use core::ptr::{self, NonNull, Unique};
use core::task::{LocalWaker, Poll}; use core::task::{LocalWaker, Poll};
use vec::Vec; use crate::vec::Vec;
use raw_vec::RawVec; use crate::raw_vec::RawVec;
use str::from_boxed_utf8_unchecked; use crate::str::from_boxed_utf8_unchecked;
/// A pointer type for heap allocation. /// A pointer type for heap allocation.
/// ///

View file

@ -151,8 +151,8 @@ use core::mem::{swap, size_of, ManuallyDrop};
use core::ptr; use core::ptr;
use core::fmt; use core::fmt;
use slice; use crate::slice;
use vec::{self, Vec}; use crate::vec::{self, Vec};
use super::SpecExtend; use super::SpecExtend;

View file

@ -8,7 +8,7 @@ use core::ops::Index;
use core::ops::RangeBounds; use core::ops::RangeBounds;
use core::{fmt, intrinsics, mem, ptr}; use core::{fmt, intrinsics, mem, ptr};
use borrow::Borrow; use crate::borrow::Borrow;
use super::node::{self, Handle, NodeRef, marker}; use super::node::{self, Handle, NodeRef, marker};
use super::search; use super::search;

View file

@ -36,8 +36,8 @@ use core::mem::{self, MaybeUninit};
use core::ptr::{self, Unique, NonNull}; use core::ptr::{self, Unique, NonNull};
use core::slice; use core::slice;
use alloc::{Global, Alloc, Layout}; use crate::alloc::{Global, Alloc, Layout};
use boxed::Box; use crate::boxed::Box;
const B: usize = 6; const B: usize = 6;
pub const MIN_LEN: usize = B - 1; pub const MIN_LEN: usize = B - 1;

View file

@ -1,6 +1,6 @@
use core::cmp::Ordering; use core::cmp::Ordering;
use borrow::Borrow; use crate::borrow::Borrow;
use super::node::{Handle, NodeRef, marker}; use super::node::{Handle, NodeRef, marker};

View file

@ -8,8 +8,8 @@ use core::fmt;
use core::iter::{Peekable, FromIterator, FusedIterator}; use core::iter::{Peekable, FromIterator, FusedIterator};
use core::ops::{BitOr, BitAnd, BitXor, Sub, RangeBounds}; use core::ops::{BitOr, BitAnd, BitXor, Sub, RangeBounds};
use borrow::Borrow; use crate::borrow::Borrow;
use collections::btree_map::{self, BTreeMap, Keys}; use crate::collections::btree_map::{self, BTreeMap, Keys};
use super::Recover; use super::Recover;
// FIXME(conventions): implement bounded iterators // FIXME(conventions): implement bounded iterators

View file

@ -20,7 +20,7 @@ use core::marker::PhantomData;
use core::mem; use core::mem;
use core::ptr::NonNull; use core::ptr::NonNull;
use boxed::Box; use crate::boxed::Box;
use super::SpecExtend; use super::SpecExtend;
/// A doubly-linked list with owned nodes. /// A doubly-linked list with owned nodes.

View file

@ -41,7 +41,7 @@ pub use self::linked_list::LinkedList;
#[doc(no_inline)] #[doc(no_inline)]
pub use self::vec_deque::VecDeque; pub use self::vec_deque::VecDeque;
use alloc::{AllocErr, LayoutErr}; use crate::alloc::{AllocErr, LayoutErr};
/// Augments `AllocErr` with a CapacityOverflow variant. /// Augments `AllocErr` with a CapacityOverflow variant.
#[derive(Clone, PartialEq, Eq, Debug)] #[derive(Clone, PartialEq, Eq, Debug)]

View file

@ -20,9 +20,9 @@ use core::slice;
use core::hash::{Hash, Hasher}; use core::hash::{Hash, Hasher};
use core::cmp; use core::cmp;
use collections::CollectionAllocErr; use crate::collections::CollectionAllocErr;
use raw_vec::RawVec; use crate::raw_vec::RawVec;
use vec::Vec; use crate::vec::Vec;
const INITIAL_CAPACITY: usize = 7; // 2^3 - 1 const INITIAL_CAPACITY: usize = 7; // 2^3 - 1
const MINIMUM_CAPACITY: usize = 1; // 2 - 1 const MINIMUM_CAPACITY: usize = 1; // 2 - 1

View file

@ -527,7 +527,7 @@ pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
#[stable(feature = "fmt_flags_align", since = "1.28.0")] #[stable(feature = "fmt_flags_align", since = "1.28.0")]
pub use core::fmt::{Alignment}; pub use core::fmt::{Alignment};
use string; use crate::string;
/// The `format` function takes an [`Arguments`] struct and returns the resulting /// The `format` function takes an [`Arguments`] struct and returns the resulting
/// formatted string. /// formatted string.

View file

@ -12,8 +12,8 @@
#![unstable(feature = "alloc", issue = "27783")] #![unstable(feature = "alloc", issue = "27783")]
#[unstable(feature = "alloc", issue = "27783")] pub use borrow::ToOwned; #[unstable(feature = "alloc", issue = "27783")] pub use crate::borrow::ToOwned;
#[unstable(feature = "alloc", issue = "27783")] pub use boxed::Box; #[unstable(feature = "alloc", issue = "27783")] pub use crate::boxed::Box;
#[unstable(feature = "alloc", issue = "27783")] pub use slice::SliceConcatExt; #[unstable(feature = "alloc", issue = "27783")] pub use crate::slice::SliceConcatExt;
#[unstable(feature = "alloc", issue = "27783")] pub use string::{String, ToString}; #[unstable(feature = "alloc", issue = "27783")] pub use crate::string::{String, ToString};
#[unstable(feature = "alloc", issue = "27783")] pub use vec::Vec; #[unstable(feature = "alloc", issue = "27783")] pub use crate::vec::Vec;

View file

@ -7,10 +7,10 @@ use core::ops::Drop;
use core::ptr::{self, NonNull, Unique}; use core::ptr::{self, NonNull, Unique};
use core::slice; use core::slice;
use alloc::{Alloc, Layout, Global, handle_alloc_error}; use crate::alloc::{Alloc, Layout, Global, handle_alloc_error};
use collections::CollectionAllocErr; use crate::collections::CollectionAllocErr;
use collections::CollectionAllocErr::*; use crate::collections::CollectionAllocErr::*;
use boxed::Box; use crate::boxed::Box;
/// A low-level utility for more ergonomically allocating, reallocating, and deallocating /// A low-level utility for more ergonomically allocating, reallocating, and deallocating
/// a buffer of memory on the heap without having to worry about all the corner cases /// a buffer of memory on the heap without having to worry about all the corner cases
@ -639,7 +639,7 @@ impl<T, A: Alloc> RawVec<T, A> {
strategy: ReserveStrategy, strategy: ReserveStrategy,
) -> Result<(), CollectionAllocErr> { ) -> Result<(), CollectionAllocErr> {
unsafe { unsafe {
use alloc::AllocErr; use crate::alloc::AllocErr;
// NOTE: we don't early branch on ZSTs here because we want this // NOTE: we don't early branch on ZSTs here because we want this
// to actually catch "asking for more than usize::MAX" in that case. // to actually catch "asking for more than usize::MAX" in that case.

View file

@ -227,7 +227,7 @@
#![stable(feature = "rust1", since = "1.0.0")] #![stable(feature = "rust1", since = "1.0.0")]
#[cfg(not(test))] #[cfg(not(test))]
use boxed::Box; use crate::boxed::Box;
#[cfg(test)] #[cfg(test)]
use std::boxed::Box; use std::boxed::Box;
@ -248,9 +248,9 @@ use core::ptr::{self, NonNull};
use core::convert::From; use core::convert::From;
use core::usize; use core::usize;
use alloc::{Global, Alloc, Layout, box_free, handle_alloc_error}; use crate::alloc::{Global, Alloc, Layout, box_free, handle_alloc_error};
use string::String; use crate::string::String;
use vec::Vec; use crate::vec::Vec;
struct RcBox<T: ?Sized> { struct RcBox<T: ?Sized> {
strong: Cell<usize>, strong: Cell<usize>,

View file

@ -93,9 +93,9 @@ use core::mem;
use core::ptr; use core::ptr;
use core::{u8, u16, u32}; use core::{u8, u16, u32};
use borrow::{Borrow, BorrowMut, ToOwned}; use crate::borrow::{Borrow, BorrowMut, ToOwned};
use boxed::Box; use crate::boxed::Box;
use vec::Vec; use crate::vec::Vec;
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub use core::slice::{Chunks, Windows}; pub use core::slice::{Chunks, Windows};
@ -137,12 +137,13 @@ pub use self::hack::to_vec;
// `core::slice::SliceExt` - we need to supply these functions for the // `core::slice::SliceExt` - we need to supply these functions for the
// `test_permutations` test // `test_permutations` test
mod hack { mod hack {
use boxed::Box;
use core::mem; use core::mem;
use crate::boxed::Box;
#[cfg(test)] #[cfg(test)]
use string::ToString; use crate::string::ToString;
use vec::Vec;
use crate::vec::Vec;
pub fn into_vec<T>(mut b: Box<[T]>) -> Vec<T> { pub fn into_vec<T>(mut b: Box<[T]>) -> Vec<T> {
unsafe { unsafe {

View file

@ -37,11 +37,11 @@ use core::ptr;
use core::iter::FusedIterator; use core::iter::FusedIterator;
use core::unicode::conversions; use core::unicode::conversions;
use borrow::{Borrow, ToOwned}; use crate::borrow::{Borrow, ToOwned};
use boxed::Box; use crate::boxed::Box;
use slice::{SliceConcatExt, SliceIndex}; use crate::slice::{SliceConcatExt, SliceIndex};
use string::String; use crate::string::String;
use vec::Vec; use crate::vec::Vec;
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub use core::str::{FromStr, Utf8Error}; pub use core::str::{FromStr, Utf8Error};

View file

@ -56,11 +56,11 @@ use core::ptr;
use core::str::pattern::Pattern; use core::str::pattern::Pattern;
use core::str::lossy; use core::str::lossy;
use collections::CollectionAllocErr; use crate::collections::CollectionAllocErr;
use borrow::{Cow, ToOwned}; use crate::borrow::{Cow, ToOwned};
use boxed::Box; use crate::boxed::Box;
use str::{self, from_boxed_utf8_unchecked, FromStr, Utf8Error, Chars}; use crate::str::{self, from_boxed_utf8_unchecked, FromStr, Utf8Error, Chars};
use vec::Vec; use crate::vec::Vec;
/// A UTF-8 encoded, growable string. /// A UTF-8 encoded, growable string.
/// ///

View file

@ -23,11 +23,11 @@ use core::hash::{Hash, Hasher};
use core::{isize, usize}; use core::{isize, usize};
use core::convert::From; use core::convert::From;
use alloc::{Global, Alloc, Layout, box_free, handle_alloc_error}; use crate::alloc::{Global, Alloc, Layout, box_free, handle_alloc_error};
use boxed::Box; use crate::boxed::Box;
use rc::is_dangling; use crate::rc::is_dangling;
use string::String; use crate::string::String;
use vec::Vec; use crate::vec::Vec;
/// A soft limit on the amount of references that may be made to an `Arc`. /// A soft limit on the amount of references that may be made to an `Arc`.
/// ///

View file

@ -11,7 +11,7 @@ mod if_arc {
use core::marker::PhantomData; use core::marker::PhantomData;
use core::mem; use core::mem;
use core::ptr::{self, NonNull}; use core::ptr::{self, NonNull};
use sync::Arc; use crate::sync::Arc;
/// A way of waking up a specific task. /// A way of waking up a specific task.
/// ///

View file

@ -70,11 +70,11 @@ use core::ptr;
use core::ptr::NonNull; use core::ptr::NonNull;
use core::slice; use core::slice;
use collections::CollectionAllocErr; use crate::collections::CollectionAllocErr;
use borrow::ToOwned; use crate::borrow::ToOwned;
use borrow::Cow; use crate::borrow::Cow;
use boxed::Box; use crate::boxed::Box;
use raw_vec::RawVec; use crate::raw_vec::RawVec;
/// A contiguous growable array type, written `Vec<T>` but pronounced 'vector'. /// A contiguous growable array type, written `Vec<T>` but pronounced 'vector'.
/// ///