Test fixes and rebase conflicts
This commit is contained in:
parent
67d13883f8
commit
582cba183f
@ -600,6 +600,7 @@ mod tests {
|
||||
use std::option::Option::{Some, None};
|
||||
use std::str::Str;
|
||||
use std::sync::atomic;
|
||||
use std::sync::atomic::Ordering::{Acquire, SeqCst};
|
||||
use std::task;
|
||||
use std::kinds::Send;
|
||||
use std::vec::Vec;
|
||||
|
@ -304,9 +304,9 @@ impl<K, V> Node<K, V> {
|
||||
let (vals_offset, _) = calculate_offsets_generic::<K, V>(capacity, true);
|
||||
|
||||
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 }),
|
||||
edges: Unique(ptr::null_mut::<u8>()),
|
||||
edges: Unique(ptr::null_mut()),
|
||||
_len: 0,
|
||||
_capacity: capacity,
|
||||
}
|
||||
@ -574,7 +574,7 @@ impl <K, V> Node<K, V> {
|
||||
|
||||
/// If the node has any children
|
||||
pub fn is_leaf(&self) -> bool {
|
||||
self.edges.is_null()
|
||||
self.edges.0.is_null()
|
||||
}
|
||||
|
||||
/// if the node has too few elements
|
||||
@ -1058,7 +1058,7 @@ impl<K, V> Node<K, V> {
|
||||
vals: RawItems::from_slice(self.vals()),
|
||||
edges: RawItems::from_slice(self.edges()),
|
||||
|
||||
ptr: self.keys as *mut u8,
|
||||
ptr: self.keys.0 as *mut u8,
|
||||
capacity: self.capacity(),
|
||||
is_leaf: self.is_leaf()
|
||||
},
|
||||
|
@ -1102,11 +1102,11 @@ impl<T: Clone> ToOwned<Vec<T>> for [T] {
|
||||
// Iterators
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[deriving(Copy)]
|
||||
#[deriving(Copy, Clone)]
|
||||
enum Direction { Pos, Neg }
|
||||
|
||||
/// An `Index` and `Direction` together.
|
||||
#[deriving(Copy)]
|
||||
#[deriving(Copy, Clone)]
|
||||
struct SizeDirection {
|
||||
size: uint,
|
||||
dir: Direction,
|
||||
|
@ -9,6 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
use core::atomic::*;
|
||||
use core::atomic::Ordering::SeqCst;
|
||||
|
||||
#[test]
|
||||
fn bool_() {
|
||||
|
@ -530,11 +530,12 @@ static H256: [u32, ..8] = [
|
||||
mod tests {
|
||||
extern crate rand;
|
||||
|
||||
use super::{Digest, Sha256, FixedBuffer};
|
||||
use self::rand::isaac::IsaacRng;
|
||||
use self::rand::Rng;
|
||||
use self::rand::isaac::IsaacRng;
|
||||
use serialize::hex::FromHex;
|
||||
use std::iter::repeat;
|
||||
use std::num::Int;
|
||||
use super::{Digest, Sha256, FixedBuffer};
|
||||
|
||||
// A normal addition - no overflow occurs
|
||||
#[test]
|
||||
|
@ -1320,9 +1320,9 @@ pub struct Iter<'a, K: 'a, V: 'a> {
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
impl<'a, K, V> Clone for Entries<'a, K, V> {
|
||||
fn clone(&self) -> Entries<'a, K, V> {
|
||||
Entries {
|
||||
impl<'a, K, V> Clone for Iter<'a, K, V> {
|
||||
fn clone(&self) -> Iter<'a, K, V> {
|
||||
Iter {
|
||||
inner: self.inner.clone()
|
||||
}
|
||||
}
|
||||
|
@ -788,9 +788,9 @@ pub struct Iter<'a, K: 'a, V: 'a> {
|
||||
}
|
||||
|
||||
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
|
||||
impl<'a, K, V> Clone for Entries<'a, K, V> {
|
||||
fn clone(&self) -> Entries<'a, K, V> {
|
||||
Entries {
|
||||
impl<'a, K, V> Clone for Iter<'a, K, V> {
|
||||
fn clone(&self) -> Iter<'a, K, V> {
|
||||
Iter {
|
||||
iter: self.iter.clone(),
|
||||
elems_left: self.elems_left
|
||||
}
|
||||
|
@ -716,6 +716,7 @@ fn real_args() -> Vec<String> {
|
||||
#[cfg(windows)]
|
||||
fn real_args() -> Vec<String> {
|
||||
use slice;
|
||||
use iter::range;
|
||||
|
||||
let mut nArgs: c_int = 0;
|
||||
let lpArgCount: *mut c_int = &mut nArgs;
|
||||
|
@ -129,7 +129,7 @@ pub fn fill_utf16_buf_and_decode(f: |*mut u16, DWORD| -> DWORD) -> Option<String
|
||||
let mut res = None;
|
||||
let mut done = false;
|
||||
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);
|
||||
if k == (0 as DWORD) {
|
||||
done = true;
|
||||
|
@ -22,5 +22,4 @@ impl Tr for St {
|
||||
|
||||
fn main() {
|
||||
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
|
||||
}
|
||||
|
@ -9,9 +9,10 @@
|
||||
// except according to those terms.
|
||||
|
||||
use std::time::Duration;
|
||||
use std::thread::Thread;
|
||||
|
||||
fn main() {
|
||||
std::task::spawn(move|| customtask());
|
||||
Thread::spawn(move|| customtask()).join().ok().unwrap();
|
||||
}
|
||||
|
||||
fn customtask() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user