Skip to content

Commit c50eea1

Browse files
committed
Test for #2242 (xfailed for now)
1 parent 8040fd8 commit c50eea1

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

src/test/auxiliary/issue_2242_a.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#[link(name = "a", vers = "0.1")];
2+
#[crate_type = "lib"];
3+
4+
iface to_str {
5+
fn to_str() -> str;
6+
}
7+
8+
impl of to_str for str {
9+
fn to_str() -> str { self }
10+
}

src/test/auxiliary/issue_2242_b.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#[link(name = "b", vers = "0.1")];
2+
#[crate_type = "lib"];
3+
4+
use a;
5+
import a::to_str;
6+
7+
impl of to_str for int {
8+
fn to_str() -> str { #fmt("%?", self) }
9+
}

src/test/auxiliary/issue_2242_c.rs

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#[link(name = "c", vers = "0.1")];
2+
#[crate_type = "lib"];
3+
4+
use a;
5+
6+
import a::to_str;
7+
8+
impl of to_str for bool {
9+
fn to_str() -> str { #fmt("%b", self) }
10+
}

src/test/run-pass/issue-2242-d.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// xfail-test
2+
// aux-build:issue_2242_a.rs
3+
// aux-build:issue_2242_b.rs
4+
// aux-build:issue_2242_c.rs
5+
6+
use a;
7+
use b;
8+
use c;
9+
10+
import b::to_str;
11+
import c::to_str;
12+
13+
fn main() {
14+
io::println("foo".to_str());
15+
io::println(1.to_str());
16+
io::println(true.to_str());
17+
}

0 commit comments

Comments
 (0)