Skip to content

Commit 0f6dd53

Browse files
committed
Split cross-crate test into own test and xfail-fast it
1 parent cc0c6fd commit 0f6dd53

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
fn f(x: int) -> int { -x }
11+
pub fn f(x: int) -> int { -x }
1212

1313
pub static F: extern fn(int) -> int = f;
1414
pub static mut MutF: extern fn(int) -> int = f;
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+
// xfail-fast
12+
// aux-build:static-function-pointer-aux.rs
13+
extern mod aux(name = "static-function-pointer-aux");
14+
15+
fn f(x: int) -> int { x }
16+
17+
fn main() {
18+
assert_eq!(aux::F(42), -42);
19+
unsafe {
20+
assert_eq!(aux::MutF(42), -42);
21+
aux::MutF = f;
22+
assert_eq!(aux::MutF(42), 42);
23+
aux::MutF = aux::f;
24+
assert_eq!(aux::MutF(42), -42);
25+
}
26+
}
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,9 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// aux-build:static-function-pointer-aux.rs
12-
extern mod aux(name = "static-function-pointer-aux");
13-
1411
fn f(x: int) -> int { x }
1512
fn g(x: int) -> int { 2 * x }
1613

@@ -24,10 +21,4 @@ fn main() {
2421
G = g;
2522
assert_eq!(G(42), 84);
2623
}
27-
assert_eq!(aux::F(42), -42);
28-
unsafe {
29-
assert_eq!(aux::MutF(42), -42);
30-
aux::MutF = f;
31-
assert_eq!(aux::MutF(42), 42);
32-
}
3324
}

0 commit comments

Comments
 (0)