Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000)

This commit is contained in:
Keegan McAllister 2014-09-16 13:00:18 -07:00
parent 8a7eefefd5
commit a640a7c5c3
74 changed files with 459 additions and 449 deletions

View file

@ -5,7 +5,7 @@
//! Small vectors in various sizes. These store a certain number of elements inline and fall back
//! to the heap for larger allocations.
use i = std::mem::init;
use std::mem::init as i;
use std::cmp;
use std::intrinsics;
use std::kinds::marker::ContravariantLifetime;
@ -57,7 +57,7 @@ trait SmallVecPrivate<T> {
unsafe fn set_ptr(&mut self, new_ptr: *mut T);
}
pub trait SmallVec<T> : SmallVecPrivate<T> {
pub trait SmallVec<T> : SmallVecPrivate<T> where T: 'static {
fn inline_size(&self) -> uint;
fn len(&self) -> uint;
fn cap(&self) -> uint;
@ -300,7 +300,7 @@ pub struct SmallVecMoveIterator<'a,T> {
lifetime: ContravariantLifetime<'a>,
}
impl<'a,T> Iterator<T> for SmallVecMoveIterator<'a,T> {
impl<'a, T: 'static> Iterator<T> for SmallVecMoveIterator<'a,T> {
#[inline]
fn next(&mut self) -> Option<T> {
unsafe {
@ -317,7 +317,7 @@ impl<'a,T> Iterator<T> for SmallVecMoveIterator<'a,T> {
}
#[unsafe_destructor]
impl<'a,T> Drop for SmallVecMoveIterator<'a,T> {
impl<'a, T: 'static> Drop for SmallVecMoveIterator<'a,T> {
fn drop(&mut self) {
// Destroy the remaining elements.
for _ in *self {}
@ -350,7 +350,7 @@ macro_rules! def_small_vector(
data: [T, ..$size],
}
impl<T> SmallVecPrivate<T> for $name<T> {
impl<T: 'static> SmallVecPrivate<T> for $name<T> {
unsafe fn set_len(&mut self, new_len: uint) {
self.len = new_len
}
@ -376,7 +376,7 @@ macro_rules! def_small_vector(
}
}
impl<T> SmallVec<T> for $name<T> {
impl<T: 'static> SmallVec<T> for $name<T> {
fn inline_size(&self) -> uint {
$size
}
@ -388,7 +388,7 @@ macro_rules! def_small_vector(
}
}
impl<T> VecLike<T> for $name<T> {
impl<T: 'static> VecLike<T> for $name<T> {
#[inline]
fn vec_len(&self) -> uint {
self.len()
@ -405,7 +405,7 @@ macro_rules! def_small_vector(
}
}
impl<T> $name<T> {
impl<T: 'static> $name<T> {
#[inline]
pub fn new() -> $name<T> {
unsafe {
@ -432,7 +432,7 @@ def_small_vector!(SmallVec32, 32)
macro_rules! def_small_vector_drop_impl(
($name:ident, $size:expr) => (
#[unsafe_destructor]
impl<T> Drop for $name<T> {
impl<T: 'static> Drop for $name<T> {
fn drop(&mut self) {
if !self.spilled() {
return
@ -467,7 +467,7 @@ def_small_vector_drop_impl!(SmallVec32, 32)
macro_rules! def_small_vector_clone_impl(
($name:ident) => (
impl<T:Clone> Clone for $name<T> {
impl<T:Clone+'static> Clone for $name<T> {
fn clone(&self) -> $name<T> {
let mut new_vector = $name::new();
for element in self.iter() {