Skip to content

Commit 53579ee

Browse files
committed
---
yaml --- r: 62788 b: refs/heads/snap-stage3 c: 5676056 h: refs/heads/master v: v3
1 parent ecec92d commit 53579ee

File tree

7 files changed

+120
-4
lines changed

7 files changed

+120
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 9ab2921300788b1f7a1f4fdd2c7b8148658f512c
4+
refs/heads/snap-stage3: 5676056ae6dd3a10d2c7323375ace3ca2fe1c308
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libextra/smallintmap.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,14 @@ impl Set<uint> for SmallIntSet {
246246
fn symmetric_difference(&self,
247247
other: &SmallIntSet,
248248
f: &fn(&uint) -> bool) -> bool {
249-
self.difference(other, f) && other.difference(self, f)
249+
let len = cmp::max(self.map.v.len() ,other.map.v.len());
250+
251+
for uint::range(0, len) |i| {
252+
if self.contains(&i) ^ other.contains(&i) {
253+
if !f(&i) { return false; }
254+
}
255+
}
256+
return true;
250257
}
251258

252259
/// Visit the values representing the uintersection
@@ -256,7 +263,14 @@ impl Set<uint> for SmallIntSet {
256263

257264
/// Visit the values representing the union
258265
fn union(&self, other: &SmallIntSet, f: &fn(&uint) -> bool) -> bool {
259-
self.each(f) && other.each(|v| self.contains(v) || f(v))
266+
let len = cmp::max(self.map.v.len() ,other.map.v.len());
267+
268+
for uint::range(0, len) |i| {
269+
if self.contains(&i) || other.contains(&i) {
270+
if !f(&i) { return false; }
271+
}
272+
}
273+
return true;
260274
}
261275
}
262276

branches/snap-stage3/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ pub fn memzero(cx: block, llptr: ValueRef, llty: TypeRef) {
15061506
let llptr = PointerCast(cx, llptr, T_ptr(T_i8()));
15071507
let llzeroval = C_u8(0);
15081508
let size = IntCast(cx, machine::llsize_of(ccx, llty), ccx.int_type);
1509-
let align = C_i32(llalign_of_min(ccx, llty) as i32);
1509+
let align = C_i32(1i32);
15101510
let volatile = C_i1(false);
15111511
Call(cx, llintrinsicfn, [llptr, llzeroval, size, align, volatile]);
15121512
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
// xfail-test
12+
use core::io::ReaderUtil;
13+
use core::io::Reader;
14+
15+
fn bar(r:@ReaderUtil) -> ~str { r.read_line() }
16+
17+
fn main() {
18+
let r : @Reader = io::stdin();
19+
let _m = bar(r as @ReaderUtil);
20+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
12+
use std::cast::transmute;
13+
use std::libc::c_void;
14+
15+
struct NonCopyable(*c_void);
16+
17+
impl Drop for NonCopyable {
18+
fn finalize(&self) {
19+
let p = **self;
20+
let v = unsafe { transmute::<*c_void, ~int>(p) };
21+
}
22+
}
23+
24+
fn main() {
25+
let t = ~0;
26+
let p = unsafe { transmute::<~int, *c_void>(t) };
27+
let z = NonCopyable(p);
28+
}
29+
30+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
fn main() {
12+
let s: ~str = ~"foobar";
13+
let mut t: &str = s;
14+
t = t.slice(0, 3); // for master: str::view(t, 0, 3) maybe
15+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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 std::num::Zero;
12+
13+
pub struct X<T> {
14+
a: T
15+
}
16+
17+
// reordering these bounds stops the ICE
18+
impl<T: Zero + Eq + Zero>
19+
Zero for X<T> {
20+
fn zero() -> X<T> {
21+
X { a: Zero::zero() }
22+
}
23+
fn is_zero(&self) -> bool {
24+
self.a.is_zero()
25+
}
26+
}
27+
28+
macro_rules! constants {
29+
() => {
30+
let _0 : X<int> = Zero::zero();
31+
}
32+
}
33+
34+
35+
pub fn main() {
36+
constants!();
37+
}

0 commit comments

Comments
 (0)