Skip to content

Commit 0a044e9

Browse files
committed
---
yaml --- r: 72157 b: refs/heads/dist-snap c: 6510fd9 h: refs/heads/master i: 72155: f32e0f2 v: v3
1 parent 3dc982c commit 0a044e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+3249
-3291
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: dcea71720852cf6b7d682d6caa054a2d6fb96068
10+
refs/heads/dist-snap: 6510fd92544467a03df93b5124644976aa79f964
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/etc/x86.supp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@
583583
{
584584
llvm-optimization-reads-uninitialized-memory-3
585585
Memcheck:Cond
586-
fun:_ZN4test9run_tests4anon13expr_fn_*
586+
fun:_ZN4test9run_tests*
587587
...
588588
}
589589

branches/dist-snap/src/libcore/core.rc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,9 @@ pub use str::{StrSlice};
9595
pub use container::{Container, Mutable};
9696
pub use vec::{CopyableVector, ImmutableVector};
9797
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
98-
pub use vec::{OwnedVector, OwnedCopyableVector, MutableVector};
98+
pub use vec::{OwnedVector, OwnedCopyableVector};
9999
pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
100100
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
101-
pub use iter::{ExtendedMutableIter};
102101

103102
pub use num::{Num, NumCast};
104103
pub use ptr::Ptr;

branches/dist-snap/src/libcore/hashmap.rs

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use container::{Container, Mutable, Map, Set};
1717
use cmp::{Eq, Equiv};
1818
use hash::Hash;
19+
use to_bytes::IterBytes;
1920
use iter::BaseIter;
2021
use hash::Hash;
2122
use iter;
@@ -71,7 +72,7 @@ fn linear_map_with_capacity_and_keys<K:Eq + Hash,V>(
7172
}
7273
}
7374

74-
priv impl<K:Hash + Eq,V> HashMap<K, V> {
75+
priv impl<K:Hash + IterBytes + Eq,V> HashMap<K, V> {
7576
#[inline(always)]
7677
fn to_bucket(&self, h: uint) -> uint {
7778
// A good hash function with entropy spread over all of the
@@ -110,8 +111,9 @@ priv impl<K:Hash + Eq,V> HashMap<K, V> {
110111
}
111112

112113
#[inline(always)]
113-
fn bucket_for_key_equiv<Q:Hash + Equiv<K>>(&self, k: &Q)
114-
-> SearchResult {
114+
fn bucket_for_key_equiv<Q:Hash + IterBytes + Equiv<K>>(&self,
115+
k: &Q)
116+
-> SearchResult {
115117
let hash = k.hash_keyed(self.k0, self.k1) as uint;
116118
self.bucket_for_key_with_hash_equiv(hash, k)
117119
}
@@ -301,15 +303,15 @@ priv impl<K:Hash + Eq,V> HashMap<K, V> {
301303
}
302304
}
303305
304-
impl<K:Hash + Eq,V> Container for HashMap<K, V> {
306+
impl<K:Hash + IterBytes + Eq,V> Container for HashMap<K, V> {
305307
/// Return the number of elements in the map
306308
fn len(&const self) -> uint { self.size }
307309
308310
/// Return true if the map contains no elements
309311
fn is_empty(&const self) -> bool { self.len() == 0 }
310312
}
311313
312-
impl<K:Hash + Eq,V> Mutable for HashMap<K, V> {
314+
impl<K:Hash + IterBytes + Eq,V> Mutable for HashMap<K, V> {
313315
/// Clear the map, removing all key-value pairs.
314316
fn clear(&mut self) {
315317
for uint::range(0, self.buckets.len()) |idx| {
@@ -319,7 +321,7 @@ impl<K:Hash + Eq,V> Mutable for HashMap<K, V> {
319321
}
320322
}
321323
322-
impl<K:Hash + Eq,V> Map<K, V> for HashMap<K, V> {
324+
impl<K:Hash + IterBytes + Eq,V> Map<K, V> for HashMap<K, V> {
323325
/// Return true if the map contains a value for the specified key
324326
fn contains_key(&self, k: &K) -> bool {
325327
match self.bucket_for_key(k) {
@@ -456,7 +458,7 @@ impl<K:Hash + Eq,V> Map<K, V> for HashMap<K, V> {
456458
}
457459
}
458460
459-
pub impl<K: Hash + Eq, V> HashMap<K, V> {
461+
pub impl<K: Hash + IterBytes + Eq, V> HashMap<K, V> {
460462
/// Create an empty HashMap
461463
fn new() -> HashMap<K, V> {
462464
HashMap::with_capacity(INITIAL_CAPACITY)
@@ -667,7 +669,8 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
667669

668670
/// Return true if the map contains a value for the specified key,
669671
/// using equivalence
670-
fn contains_key_equiv<Q:Hash + Equiv<K>>(&self, key: &Q) -> bool {
672+
fn contains_key_equiv<Q:Hash + IterBytes + Equiv<K>>(&self, key: &Q)
673+
-> bool {
671674
match self.bucket_for_key_equiv(key) {
672675
FoundEntry(_) => {true}
673676
TableFull | FoundHole(_) => {false}
@@ -677,7 +680,8 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
677680
/// Return the value corresponding to the key in the map, using
678681
/// equivalence
679682
#[cfg(stage0)]
680-
fn find_equiv<Q:Hash + Equiv<K>>(&self, k: &Q) -> Option<&'self V> {
683+
fn find_equiv<Q:Hash + IterBytes + Equiv<K>>(&self, k: &Q)
684+
-> Option<&'self V> {
681685
match self.bucket_for_key_equiv(k) {
682686
FoundEntry(idx) => Some(self.value_for_bucket(idx)),
683687
TableFull | FoundHole(_) => None,
@@ -689,15 +693,17 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
689693
#[cfg(stage1)]
690694
#[cfg(stage2)]
691695
#[cfg(stage3)]
692-
fn find_equiv<'a, Q:Hash + Equiv<K>>(&'a self, k: &Q) -> Option<&'a V> {
696+
fn find_equiv<'a, Q:Hash + IterBytes + Equiv<K>>(
697+
&'a self, k: &Q) -> Option<&'a V>
698+
{
693699
match self.bucket_for_key_equiv(k) {
694700
FoundEntry(idx) => Some(self.value_for_bucket(idx)),
695701
TableFull | FoundHole(_) => None,
696702
}
697703
}
698704
}
699705

700-
impl<K:Hash + Eq,V:Eq> Eq for HashMap<K, V> {
706+
impl<K:Hash + IterBytes + Eq,V:Eq> Eq for HashMap<K, V> {
701707
fn eq(&self, other: &HashMap<K, V>) -> bool {
702708
if self.len() != other.len() { return false; }
703709

@@ -718,31 +724,31 @@ pub struct HashSet<T> {
718724
priv map: HashMap<T, ()>
719725
}
720726

721-
impl<T:Hash + Eq> BaseIter<T> for HashSet<T> {
727+
impl<T:Hash + IterBytes + Eq> BaseIter<T> for HashSet<T> {
722728
/// Visit all values in order
723729
fn each(&self, f: &fn(&T) -> bool) { self.map.each_key(f) }
724730
fn size_hint(&self) -> Option<uint> { Some(self.len()) }
725731
}
726732

727-
impl<T:Hash + Eq> Eq for HashSet<T> {
733+
impl<T:Hash + IterBytes + Eq> Eq for HashSet<T> {
728734
fn eq(&self, other: &HashSet<T>) -> bool { self.map == other.map }
729735
fn ne(&self, other: &HashSet<T>) -> bool { self.map != other.map }
730736
}
731737

732-
impl<T:Hash + Eq> Container for HashSet<T> {
738+
impl<T:Hash + IterBytes + Eq> Container for HashSet<T> {
733739
/// Return the number of elements in the set
734740
fn len(&const self) -> uint { self.map.len() }
735741

736742
/// Return true if the set contains no elements
737743
fn is_empty(&const self) -> bool { self.map.is_empty() }
738744
}
739745

740-
impl<T:Hash + Eq> Mutable for HashSet<T> {
746+
impl<T:Hash + IterBytes + Eq> Mutable for HashSet<T> {
741747
/// Clear the set, removing all values.
742748
fn clear(&mut self) { self.map.clear() }
743749
}
744750

745-
impl<T:Hash + Eq> Set<T> for HashSet<T> {
751+
impl<T:Hash + IterBytes + Eq> Set<T> for HashSet<T> {
746752
/// Return true if the set contains a value
747753
fn contains(&self, value: &T) -> bool { self.map.contains_key(value) }
748754

@@ -810,7 +816,7 @@ impl<T:Hash + Eq> Set<T> for HashSet<T> {
810816
}
811817
}
812818

813-
pub impl <T:Hash + Eq> HashSet<T> {
819+
pub impl <T:Hash + IterBytes + Eq> HashSet<T> {
814820
/// Create an empty HashSet
815821
fn new() -> HashSet<T> {
816822
HashSet::with_capacity(INITIAL_CAPACITY)

branches/dist-snap/src/libcore/iter.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ pub trait ExtendedIter<A> {
4545
fn flat_map_to_vec<B,IB: BaseIter<B>>(&self, op: &fn(&A) -> IB) -> ~[B];
4646
}
4747

48-
pub trait ExtendedMutableIter<A> {
49-
fn eachi_mut(&mut self, blk: &fn(uint, &mut A) -> bool);
50-
}
51-
5248
pub trait EqIter<A:Eq> {
5349
fn contains(&self, x: &A) -> bool;
5450
fn count(&self, x: &A) -> uint;

branches/dist-snap/src/libcore/libc.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,12 +1097,9 @@ pub mod funcs {
10971097
unsafe fn setbuf(stream: *FILE, buf: *c_char);
10981098
// Omitted: printf and scanf variants.
10991099
unsafe fn fgetc(stream: *FILE) -> c_int;
1100-
#[fast_ffi]
11011100
unsafe fn fgets(buf: *mut c_char, n: c_int,
11021101
stream: *FILE) -> *c_char;
1103-
#[fast_ffi]
11041102
unsafe fn fputc(c: c_int, stream: *FILE) -> c_int;
1105-
#[fast_ffi]
11061103
unsafe fn fputs(s: *c_char, stream: *FILE) -> *c_char;
11071104
// Omitted: getc, getchar (might be macros).
11081105

@@ -1112,10 +1109,8 @@ pub mod funcs {
11121109
// Omitted: putc, putchar (might be macros).
11131110
unsafe fn puts(s: *c_char) -> c_int;
11141111
unsafe fn ungetc(c: c_int, stream: *FILE) -> c_int;
1115-
#[fast_ffi]
11161112
unsafe fn fread(ptr: *mut c_void, size: size_t,
11171113
nobj: size_t, stream: *FILE) -> size_t;
1118-
#[fast_ffi]
11191114
unsafe fn fwrite(ptr: *c_void, size: size_t,
11201115
nobj: size_t, stream: *FILE) -> size_t;
11211116
unsafe fn fseek(stream: *FILE, offset: c_long,
@@ -1149,13 +1144,9 @@ pub mod funcs {
11491144
-> c_long;
11501145
unsafe fn strtoul(s: *c_char, endp: **c_char, base: c_int)
11511146
-> c_ulong;
1152-
#[fast_ffi]
11531147
unsafe fn calloc(nobj: size_t, size: size_t) -> *c_void;
1154-
#[fast_ffi]
11551148
unsafe fn malloc(size: size_t) -> *c_void;
1156-
#[fast_ffi]
11571149
unsafe fn realloc(p: *c_void, size: size_t) -> *c_void;
1158-
#[fast_ffi]
11591150
unsafe fn free(p: *c_void);
11601151
unsafe fn abort() -> !;
11611152
unsafe fn exit(status: c_int) -> !;
@@ -1266,7 +1257,6 @@ pub mod funcs {
12661257
unsafe fn pclose(stream: *FILE) -> c_int;
12671258

12681259
#[link_name = "_fdopen"]
1269-
#[fast_ffi]
12701260
unsafe fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
12711261

12721262
#[link_name = "_fileno"]
@@ -1350,7 +1340,6 @@ pub mod funcs {
13501340
textmode: c_int) -> c_int;
13511341

13521342
#[link_name = "_read"]
1353-
#[fast_ffi]
13541343
unsafe fn read(fd: c_int, buf: *mut c_void, count: c_uint)
13551344
-> c_int;
13561345

@@ -1361,7 +1350,6 @@ pub mod funcs {
13611350
unsafe fn unlink(c: *c_char) -> c_int;
13621351

13631352
#[link_name = "_write"]
1364-
#[fast_ffi]
13651353
unsafe fn write(fd: c_int, buf: *c_void, count: c_uint)
13661354
-> c_int;
13671355
}
@@ -1514,7 +1502,6 @@ pub mod funcs {
15141502
unsafe fn pathconf(path: *c_char, name: c_int) -> c_long;
15151503
unsafe fn pause() -> c_int;
15161504
unsafe fn pipe(fds: *mut c_int) -> c_int;
1517-
#[fast_ffi]
15181505
unsafe fn read(fd: c_int, buf: *mut c_void,
15191506
count: size_t) -> ssize_t;
15201507
unsafe fn rmdir(path: *c_char) -> c_int;
@@ -1527,7 +1514,6 @@ pub mod funcs {
15271514
unsafe fn tcgetpgrp(fd: c_int) -> pid_t;
15281515
unsafe fn ttyname(fd: c_int) -> *c_char;
15291516
unsafe fn unlink(c: *c_char) -> c_int;
1530-
#[fast_ffi]
15311517
unsafe fn write(fd: c_int, buf: *c_void, count: size_t)
15321518
-> ssize_t;
15331519
}

branches/dist-snap/src/libcore/num/int-template.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,4 +503,4 @@ mod tests {
503503
fn test_range_step_zero_step() {
504504
for range_step(0,10,0) |_i| {}
505505
}
506-
}
506+
}

branches/dist-snap/src/libcore/num/uint-template.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,4 +474,4 @@ mod tests {
474474
fn test_range_step_zero_step_down() {
475475
for range_step(0,-10,0) |_i| {}
476476
}
477-
}
477+
}

branches/dist-snap/src/libcore/prelude.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub use container::{Container, Mutable, Map, Set};
3333
pub use hash::Hash;
3434
pub use iter::{BaseIter, ReverseIter, MutableIter, ExtendedIter, EqIter};
3535
pub use iter::{CopyableIter, CopyableOrderedIter, CopyableNonstrictIter};
36-
pub use iter::{Times, ExtendedMutableIter};
36+
pub use iter::Times;
3737
pub use num::{Num, NumCast};
3838
pub use path::GenericPath;
3939
pub use path::Path;
@@ -46,7 +46,7 @@ pub use to_str::ToStr;
4646
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
4747
pub use vec::{CopyableVector, ImmutableVector};
4848
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
49-
pub use vec::{OwnedVector, OwnedCopyableVector, MutableVector};
49+
pub use vec::{OwnedVector, OwnedCopyableVector};
5050
pub use io::{Reader, ReaderUtil, Writer, WriterUtil};
5151

5252
/* Reexported runtime types */
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use prelude::*;
12+
use super::{Reader, Writer};
13+
14+
struct PortReader<P>;
15+
16+
impl<P: GenericPort<~[u8]>> PortReader<P> {
17+
pub fn new(_port: P) -> PortReader<P> { fail!() }
18+
}
19+
20+
impl<P: GenericPort<~[u8]>> Reader for PortReader<P> {
21+
fn read(&mut self, _buf: &mut [u8]) -> Option<uint> { fail!() }
22+
23+
fn eof(&mut self) -> bool { fail!() }
24+
}
25+
26+
struct ChanWriter<C>;
27+
28+
impl<C: GenericChan<~[u8]>> ChanWriter<C> {
29+
pub fn new(_chan: C) -> ChanWriter<C> { fail!() }
30+
}
31+
32+
impl<C: GenericChan<~[u8]>> Writer for ChanWriter<C> {
33+
pub fn write(&mut self, _buf: &[u8]) { fail!() }
34+
35+
pub fn flush(&mut self) { fail!() }
36+
}
37+
38+
struct ReaderPort<R>;
39+
40+
impl<R: Reader> ReaderPort<R> {
41+
pub fn new(_reader: R) -> ReaderPort<R> { fail!() }
42+
}
43+
44+
impl<R: Reader> GenericPort<~[u8]> for ReaderPort<R> {
45+
fn recv(&self) -> ~[u8] { fail!() }
46+
47+
fn try_recv(&self) -> Option<~[u8]> { fail!() }
48+
}
49+
50+
struct WriterChan<W>;
51+
52+
impl<W: Writer> WriterChan<W> {
53+
pub fn new(_writer: W) -> WriterChan<W> { fail!() }
54+
}
55+
56+
impl<W: Writer> GenericChan<~[u8]> for WriterChan<W> {
57+
fn send(&self, _x: ~[u8]) { fail!() }
58+
}
59+

0 commit comments

Comments
 (0)