Skip to content

Commit 58eeb07

Browse files
committed
auto merge of #12165 : fhahn/rust/change-some-tests, r=alexcrichton
While working on #11363 I stumbled over a couple of ignored tests, that seem to be fixed or invalid. * src/test/run-pass/issue-3559.rs was fixed in #4726 * src/test/compile-fail/borrowck-call-sendfn.rs was fixed in #2978 * update src/test/compile-fail/issue-5500-1.rs to work with current Rust (I'm not 100% sure if the original condition is tested as mentioned in #5500, but I think so) * removed src/test/compile-fail/issue-5500.rs because it is tested in src/test/run-fail/issue-5500.rs (they are the same test cases, I just renamed src/test/run-fail/addr-of-bot.rs to be consistent with the other issue name
2 parents c62f6ce + 195d8fd commit 58eeb07

9 files changed

+23
-61
lines changed

src/test/compile-fail/borrowck-call-sendfn.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-test #2978
12-
1311
struct Foo {
1412
f: proc()
1513
}
1614

17-
fn call(x: @Foo) {
18-
x.f(); //~ ERROR foo
19-
//~^ NOTE bar
15+
fn call(x: Foo) {
16+
x.f(); //~ ERROR does not implement any method in scope named `f`
2017
}
2118

2219
fn main() {}

src/test/compile-fail/issue-5500-1.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-test
12-
1311
struct TrieMapIterator<'a> {
14-
priv node: &'a uint
12+
node: &'a uint
1513
}
1614

1715
fn main() {
1816
let a = 5;
19-
let _iter = TrieMapIterator{node: &a}; //~ ERROR bad
20-
_iter.node = &
17+
let _iter = TrieMapIterator{node: &a};
18+
_iter.node = & //~ ERROR cannot assign to immutable field
2119
fail!()
2220
}

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

-13
This file was deleted.
File renamed without changes.

src/test/compile-fail/issue-897-2.rs

+3-16
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
1-
// Copyright 2014 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-
// ignore-test
12-
// ignored because the lint pass doesn't know to ignore standard library
13-
// stuff.
14-
15-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
162
// file at the top-level directory of this distribution and at
173
// http://rust-lang.org/COPYRIGHT.
184
//
@@ -29,4 +15,5 @@ fn f() -> ! {
2915
return g();
3016
g(); //~ ERROR: unreachable statement
3117
}
32-
fn main() { }
18+
19+
fn main() { f() }

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

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

11-
// ignore-test
11+
// error-pattern: unreachable statement
1212

1313
#[deny(unreachable_code)];
1414

1515
fn f() -> ! {
1616
return fail!();
17-
fail!(); //~ ERROR: unreachable statement
17+
fail!(); // the unreachable statement error is in <std macro>, at this line, there
18+
// only is a note
1819
}
19-
fn main() { }
20+
21+
fn main() { f() }

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

-2
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-
// ignore-test
12-
1311
extern mod extra;
1412

1513
fn f() {
File renamed without changes.

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

+10-17
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,20 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-test #4276
11+
use std::hashmap::HashMap;
1212

13-
// rustc --test map_to_str.rs && ./map_to_str
14-
extern mod extra;
15-
16-
fn check_strs(actual: &str, expected: &str) -> bool
17-
{
18-
if actual != expected
19-
{
20-
println!("Found %s, but expected %s", actual, expected);
13+
fn check_strs(actual: &str, expected: &str) -> bool {
14+
if actual != expected {
15+
println!("Found {}, but expected {}", actual, expected);
2116
return false;
2217
}
2318
return true;
2419
}
2520

26-
fn tester()
27-
{
28-
let mut table = std::hashmap::HashMap::new();
29-
table.insert(@~"one", 1);
30-
table.insert(@~"two", 2);
31-
assert!(check_strs(table.to_str(), ~"xxx")); // not sure what expected should be
21+
pub fn main() {
22+
let mut table = HashMap::new();
23+
table.insert(~"one", 1);
24+
table.insert(~"two", 2);
25+
assert!(check_strs(table.to_str(), "{one: 1, two: 2}") ||
26+
check_strs(table.to_str(), "{two: 2, one: 1}"));
3227
}
33-
34-
pub fn main() {}

0 commit comments

Comments
 (0)