Test fixes and rebase conflicts

This commit is contained in:
Alex Crichton 2014-12-30 16:29:27 -08:00
parent 67d13883f8
commit 582cba183f
11 changed files with 21 additions and 17 deletions

View File

@ -600,6 +600,7 @@ mod tests {
use std::option::Option::{Some, None}; use std::option::Option::{Some, None};
use std::str::Str; use std::str::Str;
use std::sync::atomic; use std::sync::atomic;
use std::sync::atomic::Ordering::{Acquire, SeqCst};
use std::task; use std::task;
use std::kinds::Send; use std::kinds::Send;
use std::vec::Vec; use std::vec::Vec;

View File

@ -304,9 +304,9 @@ impl<K, V> Node<K, V> {
let (vals_offset, _) = calculate_offsets_generic::<K, V>(capacity, true); let (vals_offset, _) = calculate_offsets_generic::<K, V>(capacity, true);
Node { Node {
keys: Unique(buffer as *mut K). keys: Unique(buffer as *mut K),
vals: Unique(unsafe { buffer.offset(vals_offset as int) as *mut V }), vals: Unique(unsafe { buffer.offset(vals_offset as int) as *mut V }),
edges: Unique(ptr::null_mut::<u8>()), edges: Unique(ptr::null_mut()),
_len: 0, _len: 0,
_capacity: capacity, _capacity: capacity,
} }
@ -574,7 +574,7 @@ impl <K, V> Node<K, V> {
/// If the node has any children /// If the node has any children
pub fn is_leaf(&self) -> bool { pub fn is_leaf(&self) -> bool {
self.edges.is_null() self.edges.0.is_null()
} }
/// if the node has too few elements /// if the node has too few elements
@ -1058,7 +1058,7 @@ impl<K, V> Node<K, V> {
vals: RawItems::from_slice(self.vals()), vals: RawItems::from_slice(self.vals()),
edges: RawItems::from_slice(self.edges()), edges: RawItems::from_slice(self.edges()),
ptr: self.keys as *mut u8, ptr: self.keys.0 as *mut u8,
capacity: self.capacity(), capacity: self.capacity(),
is_leaf: self.is_leaf() is_leaf: self.is_leaf()
}, },

View File

@ -1102,11 +1102,11 @@ impl<T: Clone> ToOwned<Vec<T>> for [T] {
// Iterators // Iterators
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#[deriving(Copy)] #[deriving(Copy, Clone)]
enum Direction { Pos, Neg } enum Direction { Pos, Neg }
/// An `Index` and `Direction` together. /// An `Index` and `Direction` together.
#[deriving(Copy)] #[deriving(Copy, Clone)]
struct SizeDirection { struct SizeDirection {
size: uint, size: uint,
dir: Direction, dir: Direction,

View File

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
use core::atomic::*; use core::atomic::*;
use core::atomic::Ordering::SeqCst;
#[test] #[test]
fn bool_() { fn bool_() {

View File

@ -530,11 +530,12 @@ static H256: [u32, ..8] = [
mod tests { mod tests {
extern crate rand; extern crate rand;
use super::{Digest, Sha256, FixedBuffer};
use self::rand::isaac::IsaacRng;
use self::rand::Rng; use self::rand::Rng;
use self::rand::isaac::IsaacRng;
use serialize::hex::FromHex; use serialize::hex::FromHex;
use std::iter::repeat;
use std::num::Int; use std::num::Int;
use super::{Digest, Sha256, FixedBuffer};
// A normal addition - no overflow occurs // A normal addition - no overflow occurs
#[test] #[test]

View File

@ -1320,9 +1320,9 @@ pub struct Iter<'a, K: 'a, V: 'a> {
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
impl<'a, K, V> Clone for Entries<'a, K, V> { impl<'a, K, V> Clone for Iter<'a, K, V> {
fn clone(&self) -> Entries<'a, K, V> { fn clone(&self) -> Iter<'a, K, V> {
Entries { Iter {
inner: self.inner.clone() inner: self.inner.clone()
} }
} }

View File

@ -788,9 +788,9 @@ pub struct Iter<'a, K: 'a, V: 'a> {
} }
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]` // FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
impl<'a, K, V> Clone for Entries<'a, K, V> { impl<'a, K, V> Clone for Iter<'a, K, V> {
fn clone(&self) -> Entries<'a, K, V> { fn clone(&self) -> Iter<'a, K, V> {
Entries { Iter {
iter: self.iter.clone(), iter: self.iter.clone(),
elems_left: self.elems_left elems_left: self.elems_left
} }

View File

@ -716,6 +716,7 @@ fn real_args() -> Vec<String> {
#[cfg(windows)] #[cfg(windows)]
fn real_args() -> Vec<String> { fn real_args() -> Vec<String> {
use slice; use slice;
use iter::range;
let mut nArgs: c_int = 0; let mut nArgs: c_int = 0;
let lpArgCount: *mut c_int = &mut nArgs; let lpArgCount: *mut c_int = &mut nArgs;

View File

@ -129,7 +129,7 @@ pub fn fill_utf16_buf_and_decode(f: |*mut u16, DWORD| -> DWORD) -> Option<String
let mut res = None; let mut res = None;
let mut done = false; let mut done = false;
while !done { while !done {
let mut buf: Vec<u16> = repeat(0u16).take(n).collect(); let mut buf: Vec<u16> = repeat(0u16).take(n as uint).collect();
let k = f(buf.as_mut_ptr(), n); let k = f(buf.as_mut_ptr(), n);
if k == (0 as DWORD) { if k == (0 as DWORD) {
done = true; done = true;

View File

@ -22,5 +22,4 @@ impl Tr for St {
fn main() { fn main() {
let _: &Tr = &St; //~ ERROR cannot convert to a trait object because trait `Tr` is not let _: &Tr = &St; //~ ERROR cannot convert to a trait object because trait `Tr` is not
//~^ NOTE cannot call a static method (`foo`) through a trait object
} }

View File

@ -9,9 +9,10 @@
// except according to those terms. // except according to those terms.
use std::time::Duration; use std::time::Duration;
use std::thread::Thread;
fn main() { fn main() {
std::task::spawn(move|| customtask()); Thread::spawn(move|| customtask()).join().ok().unwrap();
} }
fn customtask() { fn customtask() {