Skip to content

Commit 3c7c4a6

Browse files
committed
---
yaml --- r: 139863 b: refs/heads/try2 c: d2a81b9 h: refs/heads/master i: 139861: 4ef4b83 139859: 4ea2644 139855: f5e5230 v: v3
1 parent d384bab commit 3c7c4a6

Some content is hidden

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

69 files changed

+876
-1823
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: e4f35a7326e4ea2af9b6000080819208a7f6d722
8+
refs/heads/try2: d2a81b95c3e2ccfdba0324caae531ce3528ed4e2
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,3 @@ config.stamp
8686
.DS_Store
8787
src/etc/dl
8888
.settings/
89-
build/

branches/try2/doc/tutorial.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,9 +1669,6 @@ do spawn {
16691669
}
16701670
~~~~
16711671

1672-
If you want to see the output of `debug!` statements, you will need to turn on `debug!` logging.
1673-
To enable `debug!` logging, set the RUST_LOG environment variable to `debug` (e.g., with bash, `export RUST_LOG=debug`)
1674-
16751672
## For loops
16761673

16771674
The most common way to express iteration in Rust is with a `for`

branches/try2/mk/rt.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ RUNTIME_CXXS_$(1) := \
7676
rt/boxed_region.cpp \
7777
rt/arch/$$(HOST_$(1))/context.cpp \
7878
rt/arch/$$(HOST_$(1))/gpr.cpp \
79-
rt/rust_android_dummy.cpp \
80-
rt/rust_test_helpers.cpp
79+
rt/rust_android_dummy.cpp
8180

8281
RUNTIME_CS_$(1) := rt/linenoise/linenoise.c rt/linenoise/utf8.c
8382

branches/try2/src/etc/x86.supp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -654,11 +654,3 @@
654654
fun:_ZN5visit30visit_struct_dtor_helper_*
655655
...
656656
}
657-
658-
{
659-
llvm-optimization-reads-uninitialized-memory-16
660-
Memcheck:Cond
661-
fun:_ZN7ast_map6map_fn*
662-
fun:_ZN5visit30visit_struct_dtor_helper*
663-
...
664-
}

branches/try2/src/libcore/io.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ pub trait ReaderUtil {
176176
fn read_bytes(&self, len: uint) -> ~[u8];
177177

178178
/**
179-
* Reads up until a specific byte is seen or EOF.
179+
* Reads up until a specific character or EOF.
180180
*
181181
* The `include` parameter specifies if the character should be included
182182
* in the returned string.
@@ -185,7 +185,7 @@ pub trait ReaderUtil {
185185
*
186186
* None right now.
187187
*/
188-
fn read_until(&self, c: u8, include: bool) -> ~str;
188+
fn read_until(&self, c: char, include: bool) -> ~str;
189189

190190
/**
191191
* Reads up until the first '\n' or EOF.
@@ -577,7 +577,7 @@ impl<T:Reader> ReaderUtil for T {
577577
bytes
578578
}
579579

580-
fn read_until(&self, c: u8, include: bool) -> ~str {
580+
fn read_until(&self, c: char, include: bool) -> ~str {
581581
let mut bytes = ~[];
582582
loop {
583583
let ch = self.read_byte();
@@ -593,7 +593,7 @@ impl<T:Reader> ReaderUtil for T {
593593
}
594594

595595
fn read_line(&self) -> ~str {
596-
self.read_until('\n' as u8, false)
596+
self.read_until('\n', false)
597597
}
598598

599599
fn read_chars(&self, n: uint) -> ~[char] {
@@ -667,7 +667,7 @@ impl<T:Reader> ReaderUtil for T {
667667
}
668668

669669
fn read_c_str(&self) -> ~str {
670-
self.read_until(0u8, false)
670+
self.read_until(0 as char, false)
671671
}
672672

673673
fn read_whole_stream(&self) -> ~[u8] {
@@ -693,7 +693,7 @@ impl<T:Reader> ReaderUtil for T {
693693
// include the \n, so that we can distinguish an entirely empty
694694
// line read after "...\n", and the trailing empty line in
695695
// "...\n\n".
696-
let mut line = self.read_until('\n' as u8, true);
696+
let mut line = self.read_until('\n', true);
697697

698698
// blank line at the end of the reader is ignored
699699
if self.eof() && line.is_empty() { break; }

branches/try2/src/libcore/iterator.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ pub trait IteratorUtil<A> {
2222
// FIXME: #5898: should be called map
2323
fn transform<'r, B>(self, f: &'r fn(A) -> B) -> MapIterator<'r, A, B, Self>;
2424
fn filter<'r>(self, predicate: &'r fn(&A) -> bool) -> FilterIterator<'r, A, Self>;
25-
fn enumerate(self) -> EnumerateIterator<Self>;
2625
fn advance(&mut self, f: &fn(A) -> bool);
2726
}
2827

@@ -43,11 +42,6 @@ impl<A, T: Iterator<A>> IteratorUtil<A> for T {
4342
FilterIterator{iter: self, predicate: predicate}
4443
}
4544

46-
#[inline(always)]
47-
fn enumerate(self) -> EnumerateIterator<T> {
48-
EnumerateIterator{iter: self, count: 0}
49-
}
50-
5145
/// A shim implementing the `for` loop iteration protocol for iterator objects
5246
#[inline]
5347
fn advance(&mut self, f: &fn(A) -> bool) {
@@ -110,22 +104,3 @@ impl<'self, A, B, T: Iterator<A>> Iterator<B> for MapIterator<'self, A, B, T> {
110104
}
111105
}
112106
}
113-
114-
pub struct EnumerateIterator<T> {
115-
priv iter: T,
116-
priv count: uint
117-
}
118-
119-
impl<A, T: Iterator<A>> Iterator<(uint, A)> for EnumerateIterator<T> {
120-
#[inline]
121-
fn next(&mut self) -> Option<(uint, A)> {
122-
match self.iter.next() {
123-
Some(a) => {
124-
let ret = Some((self.count, a));
125-
self.count += 1;
126-
ret
127-
}
128-
_ => None
129-
}
130-
}
131-
}

branches/try2/src/libcore/num/int-template.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,30 @@ impl ops::Modulo<T,T> for T {
199199
impl ops::Neg<T> for T {
200200
fn neg(&self) -> T { -*self }
201201
}
202+
#[cfg(notest)]
203+
impl ops::BitOr<T,T> for T {
204+
fn bitor(&self, other: &T) -> T { *self | *other }
205+
}
206+
#[cfg(notest)]
207+
impl ops::BitAnd<T,T> for T {
208+
fn bitand(&self, other: &T) -> T { *self & *other }
209+
}
210+
#[cfg(notest)]
211+
impl ops::BitXor<T,T> for T {
212+
fn bitxor(&self, other: &T) -> T { *self ^ *other }
213+
}
214+
#[cfg(notest)]
215+
impl ops::Shl<T,T> for T {
216+
fn shl(&self, other: &T) -> T { *self << *other }
217+
}
218+
#[cfg(notest)]
219+
impl ops::Shr<T,T> for T {
220+
fn shr(&self, other: &T) -> T { *self >> *other }
221+
}
222+
#[cfg(notest)]
223+
impl ops::Not<T> for T {
224+
fn not(&self) -> T { !*self }
225+
}
202226
203227
// String conversion functions and impl str -> num
204228
@@ -283,6 +307,16 @@ mod tests {
283307
use super::inst::T;
284308
use prelude::*;
285309
310+
#[test]
311+
fn test_bitwise_ops() {
312+
assert!(0b1110 as T == (0b1100 as T).bitor(&(0b1010 as T)));
313+
assert!(0b1000 as T == (0b1100 as T).bitand(&(0b1010 as T)));
314+
assert!(0b0110 as T == (0b1100 as T).bitxor(&(0b1010 as T)));
315+
assert!(0b1110 as T == (0b0111 as T).shl(&(1 as T)));
316+
assert!(0b0111 as T == (0b1110 as T).shr(&(1 as T)));
317+
assert!(-(0b11 as T) - (1 as T) == (0b11 as T).not());
318+
}
319+
286320
#[test]
287321
fn test_from_str() {
288322
assert!(from_str(~"0") == Some(0 as T));

branches/try2/src/libcore/num/uint-template.rs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,30 @@ impl ops::Modulo<T,T> for T {
164164
impl ops::Neg<T> for T {
165165
fn neg(&self) -> T { -*self }
166166
}
167+
#[cfg(notest)]
168+
impl ops::BitOr<T,T> for T {
169+
fn bitor(&self, other: &T) -> T { *self | *other }
170+
}
171+
#[cfg(notest)]
172+
impl ops::BitAnd<T,T> for T {
173+
fn bitand(&self, other: &T) -> T { *self & *other }
174+
}
175+
#[cfg(notest)]
176+
impl ops::BitXor<T,T> for T {
177+
fn bitxor(&self, other: &T) -> T { *self ^ *other }
178+
}
179+
#[cfg(notest)]
180+
impl ops::Shl<T,T> for T {
181+
fn shl(&self, other: &T) -> T { *self << *other }
182+
}
183+
#[cfg(notest)]
184+
impl ops::Shr<T,T> for T {
185+
fn shr(&self, other: &T) -> T { *self >> *other }
186+
}
187+
#[cfg(notest)]
188+
impl ops::Not<T> for T {
189+
fn not(&self) -> T { !*self }
190+
}
167191
168192
// String conversion functions and impl str -> num
169193
@@ -247,6 +271,17 @@ mod tests {
247271
use super::*;
248272
use super::inst::T;
249273
use prelude::*;
274+
275+
#[test]
276+
fn test_bitwise_ops() {
277+
assert!(0b1110 as T == (0b1100 as T).bitor(&(0b1010 as T)));
278+
assert!(0b1000 as T == (0b1100 as T).bitand(&(0b1010 as T)));
279+
assert!(0b0110 as T == (0b1100 as T).bitxor(&(0b1010 as T)));
280+
assert!(0b1110 as T == (0b0111 as T).shl(&(1 as T)));
281+
assert!(0b0111 as T == (0b1110 as T).shr(&(1 as T)));
282+
assert!(max_value - (0b1011 as T) == (0b1011 as T).not());
283+
}
284+
250285
#[test]
251286
pub fn test_to_str() {
252287
assert!(to_str_radix(0 as T, 10u) == ~"0");

branches/try2/src/libcore/repr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ use io::{Writer, WriterUtil};
2323
use libc::c_void;
2424
use managed;
2525
use ptr;
26-
#[cfg(stage0)] use sys;
2726
use reflect;
2827
use reflect::{MovePtr, align};
28+
use sys;
2929
use to_str::ToStr;
3030
use vec::UnboxedVecRepr;
3131
use vec::raw::{VecRepr, SliceRepr};
@@ -479,7 +479,7 @@ impl TyVisitor for ReprVisitor {
479479
}
480480

481481
#[cfg(not(stage0))]
482-
fn visit_enter_enum(&self, _n_variants: uint,
482+
fn visit_enter_enum(&self, n_variants: uint,
483483
get_disr: extern unsafe fn(ptr: *Opaque) -> int,
484484
_sz: uint, _align: uint) -> bool {
485485
let disr = unsafe { get_disr(transmute(self.ptr)) };

branches/try2/src/libcore/rt/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ macro_rules! rtdebug (
3232
($( $arg:expr),+) => ( $(let _ = $arg)*; )
3333
)
3434

35-
#[path = "sched/mod.rs"]
3635
mod sched;
3736
mod rtio;
3837
pub mod uvll;

0 commit comments

Comments
 (0)