Skip to content

Commit 7048e05

Browse files
committed
auto merge of #8932 : huonw/rust/closed-issues, r=thestinger
2 parents d252d81 + 490c0c7 commit 7048e05

35 files changed

+196
-108
lines changed

src/test/compile-fail/arc-cant-nest-rw-arc-3177.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
12-
// error-pattern: instantiating a type parameter with an incompatible type
1311
extern mod extra;
14-
use extra::arc::rw_arc;
12+
use extra::arc::RWArc;
1513

1614
fn main() {
17-
let arc1 = ~rw_arc(true);
18-
let _arc2 = ~rw_arc(arc1);
15+
let arc1 = RWArc::new(true);
16+
let _arc2 = RWArc::new(arc1); //~ ERROR instantiating a type parameter with an incompatible type
1917
}

src/test/compile-fail/bind-by-move-no-lvalues-2.rs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// xfail-test #3024
21
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
32
// file at the top-level directory of this distribution and at
43
// http://rust-lang.org/COPYRIGHT.
@@ -20,7 +19,7 @@ impl Drop for X {
2019
}
2120

2221
fn unwrap(x: X) -> ~str {
23-
let X { x: y } = x; //~ ERROR cannot bind by-move within struct
22+
let X { x: y } = x; //~ ERROR cannot move out of type
2423
y
2524
}
2625

src/test/compile-fail/bind-by-move-no-lvalues-1.rs renamed to src/test/compile-fail/functional-struct-update-noncopyable.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
11+
// issue 7327
1212

13-
struct X { x: (), }
13+
// xfail-fast #7103
14+
extern mod extra;
15+
use extra::arc::*;
1416

15-
impl Drop for X {
16-
fn drop(&self) {
17-
error!("destructor runs");
18-
}
19-
}
17+
struct A { y: Arc<int>, x: Arc<int> }
2018

19+
impl Drop for A {
20+
fn drop(&self) { println(fmt!("x=%?", self.x.get())); }
21+
}
2122
fn main() {
22-
let x = Some(X { x: () });
23-
match x {
24-
Some(_z) => { }, //~ ERROR cannot bind by-move when matching an lvalue
25-
None => fail!()
26-
}
23+
let a = A { y: Arc::new(1), x: Arc::new(2) };
24+
let _b = A { y: Arc::new(3), ..a };
25+
let _c = a; //~ ERROR use of moved value
2726
}

src/test/compile-fail/issue-2951.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
1211
fn foo<T, U>(x: T, y: U) {
1312
let mut xx = x;
14-
xx = y; // error message should mention T and U, not 'a and 'b
13+
xx = y; //~ ERROR expected `T` but found `U`
1514
}
1615

1716
fn main() {

src/test/compile-fail/issue-3080.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
1211
struct x(());
1312
impl x {
14-
pub unsafe fn with() { } // This should fail
13+
pub unsafe fn with(&self) { }
1514
}
1615

1716
fn main() {
18-
x(()).with();
17+
x(()).with(); //~ ERROR requires unsafe function or block
1918
}

src/test/compile-fail/issue-3973.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// except according to those terms.
1010

1111
// xfail-test
12+
use std::io;
13+
1214
struct Point {
1315
x: float,
1416
y: float,

src/test/compile-fail/issue-5062.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
12-
fn main() { fmt!("%?", None); } //~ ERROR can't resolve type variable
11+
fn main() { fmt!("%?", None); } //~ ERROR unconstrained type

src/test/compile-fail/issue-6977.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
//xfail-test
2-
31
// Trying to create a fixed-length vector with a negative size
42

53
fn main() {
6-
let _x = [0,..-1];
4+
let _x = [0,..-1]; //~ ERROR found negative integer
75
}

src/test/compile-fail/view-items-at-top.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extern mod extra;
1515
fn f() {
1616
}
1717

18-
use extra::net; //~ ERROR view items must be declared at the top
18+
use extra::net; //~ ERROR `use` and `extern mod` declarations must precede items
1919

2020
fn main() {
2121
}

src/test/run-pass/autoderef-method-priority.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// xfail-test #5321
21
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
32
// file at the top-level directory of this distribution and at
43
// http://rust-lang.org/COPYRIGHT.

src/test/run-pass/deriving-cmp-generic-struct-enum.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// xfail-test #5530
2-
31
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
42
// file at the top-level directory of this distribution and at
53
// http://rust-lang.org/COPYRIGHT.
@@ -18,18 +16,18 @@ enum ES<T> {
1816

1917

2018
pub fn main() {
21-
let es11 = ES1 {x: 1}, es12 = ES1 {x: 2}, es21 = ES2 {x: 1, y: 1}, es22 = ES2 {x: 1, y: 2};
19+
let (es11, es12, es21, es22) = (ES1 {x: 1}, ES1 {x: 2}, ES2 {x: 1, y: 1}, ES2 {x: 1, y: 2});
2220

2321
// in order for both Ord and TotalOrd
2422
let ess = [es11, es12, es21, es22];
2523

26-
for ess.eachi |i, es1| {
27-
for ess.eachi |j, es2| {
24+
for (i, es1) in ess.iter().enumerate() {
25+
for (j, es2) in ess.iter().enumerate() {
2826
let ord = i.cmp(&j);
2927

3028
let eq = i == j;
31-
let lt = i < j, le = i <= j;
32-
let gt = i > j, ge = i >= j;
29+
let (lt, le) = (i < j, i <= j);
30+
let (gt, ge) = (i > j, i >= j);
3331

3432
// Eq
3533
assert_eq!(*es1 == *es2, eq);
@@ -49,4 +47,4 @@ pub fn main() {
4947
assert_eq!(es1.cmp(es2), ord);
5048
}
5149
}
52-
}
50+
}

src/test/run-pass/estr-shared.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
1211
pub fn main() {
13-
let x : @str = @"hello";
12+
let _x : @str = @"hello";
1413
}

src/test/run-pass/extern-pass-TwoU16s.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// xfail-test #5744 fails on 32 bit
12+
1113
// Test a foreign function that accepts and returns a struct
1214
// by value.
1315

14-
// xfail-test #5744
15-
1616
#[deriving(Eq)]
1717
struct TwoU16s {
1818
one: u16, two: u16
@@ -22,6 +22,7 @@ extern {
2222
pub fn rust_dbg_extern_identity_TwoU16s(v: TwoU16s) -> TwoU16s;
2323
}
2424

25+
#[fixed_stack_segment] #[inline(never)]
2526
pub fn main() {
2627
unsafe {
2728
let x = TwoU16s {one: 22, two: 23};

src/test/run-pass/extern-pass-TwoU8s.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// xfail-test #5744 fails on 32 bit
12+
1113
// Test a foreign function that accepts and returns a struct
1214
// by value.
1315

14-
// xfail-test #5744
15-
1616
#[deriving(Eq)]
1717
struct TwoU8s {
1818
one: u8, two: u8
@@ -22,6 +22,7 @@ extern {
2222
pub fn rust_dbg_extern_identity_TwoU8s(v: TwoU8s) -> TwoU8s;
2323
}
2424

25+
#[fixed_stack_segment] #[inline(never)]
2526
pub fn main() {
2627
unsafe {
2728
let x = TwoU8s {one: 22, two: 23};

src/test/run-pass/issue-1516.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
12-
pub fn main() { let early_error: @fn(str) -> ! = {|msg| fail!() }; }
11+
pub fn main() {
12+
let early_error: @fn(&str) -> ! = |_msg| { fail!() };
13+
}

src/test/run-pass/issue-3794.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
1211
trait T {
1312
fn print(&self);
1413
}

src/test/run-pass/issue-3874.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test FIXME #3874
1211
enum PureCounter { PureCounter(uint) }
1312

14-
fn each(self: PureCounter, blk: &fn(v: &uint)) {
15-
let PureCounter(ref x) = self;
13+
fn each(thing: PureCounter, blk: &fn(v: &uint)) {
14+
let PureCounter(ref x) = thing;
1615
blk(x);
1716
}
1817

src/test/run-pass/issue-3895.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
1211
pub fn main() {
1312
enum State { BadChar, BadSyntax }
1413

src/test/compile-fail/issue-3991.rs renamed to src/test/run-pass/issue-3991.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
1211
struct HasNested {
13-
mut nest: ~[~[int]],
12+
nest: ~[~[int]],
1413
}
1514

1615
impl HasNested {
17-
fn method_push_local(&self) {
16+
fn method_push_local(&mut self) {
1817
self.nest[0].push(0);
1918
}
2019
}

src/test/run-pass/issue-4025.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
# if b { x } else { y } requires identical types for x and y
13+
*/
14+
15+
fn print1(b: bool, s1: &str, s2: &str) {
16+
println(if b { s1 } else { s2 });
17+
}
18+
fn print2<'a, 'b>(b: bool, s1: &'a str, s2: &'b str) {
19+
println(if b { s1 } else { s2 });
20+
}
21+
fn print3(b: bool, s1: &str, s2: &str) {
22+
let mut s: &str;
23+
if b { s = s1; } else { s = s2; }
24+
println(s);
25+
}
26+
fn print4<'a, 'b>(b: bool, s1: &'a str, s2: &'b str) {
27+
let mut s: &str;
28+
if b { s = s1; } else { s = s2; }
29+
println(s);
30+
}
31+
32+
pub fn main() {}

src/test/run-pass/issue-5280.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
12-
1311
type FontTableTag = u32;
1412

1513
trait FontTableTagConversions {

src/test/run-pass/issue-5315.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
1211
struct A(bool);
1312

1413
fn main() {

src/test/run-pass/issue-5688.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
# Corrupted initialization in the static struct
13+
14+
...should print &[1, 2, 3] but instead prints something like
15+
&[4492532864, 24]. It is pretty evident that the compiler messed up
16+
with the representation of [int, ..n] and [int] somehow, or at least
17+
failed to typecheck correctly.
18+
*/
19+
20+
struct X { vec: &'static [int] }
21+
static V: &'static [X] = &[X { vec: &[1, 2, 3] }];
22+
fn main() {
23+
for &v in V.iter() {
24+
println(fmt!("%?", v.vec));
25+
}
26+
}

0 commit comments

Comments
 (0)