Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev.

This commit is contained in:
Ms2ger 2015-03-11 11:08:57 +01:00 committed by Josh Matthews
parent 65d4b12bf2
commit 5f15eb5fbf
140 changed files with 1420 additions and 1222 deletions

View file

@ -4,14 +4,14 @@
//! Utility functions for doubly-linked lists.
use std::collections::DList;
use std::collections::LinkedList;
use std::mem;
/// Splits the head off a list in O(1) time, and returns the head.
pub fn split_off_head<T>(list: &mut DList<T>) -> DList<T> {
pub fn split_off_head<T>(list: &mut LinkedList<T>) -> LinkedList<T> {
// FIXME: Work around https://github.com/rust-lang/rust/issues/22244
if list.len() == 1 {
return mem::replace(list, DList::new());
return mem::replace(list, LinkedList::new());
}
let tail = list.split_off(1);
mem::replace(list, tail)
@ -19,7 +19,7 @@ pub fn split_off_head<T>(list: &mut DList<T>) -> DList<T> {
/// Prepends the items in the other list to this one, leaving the other list empty.
#[inline]
pub fn prepend_from<T>(this: &mut DList<T>, other: &mut DList<T>) {
pub fn prepend_from<T>(this: &mut LinkedList<T>, other: &mut LinkedList<T>) {
other.append(this);
mem::swap(this, other);
}