Test for #2242 (xfailed for now)
This commit is contained in:
parent
8040fd86bf
commit
c50eea17d4
10
src/test/auxiliary/issue_2242_a.rs
Normal file
10
src/test/auxiliary/issue_2242_a.rs
Normal file
@ -0,0 +1,10 @@
|
||||
#[link(name = "a", vers = "0.1")];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
iface to_str {
|
||||
fn to_str() -> str;
|
||||
}
|
||||
|
||||
impl of to_str for str {
|
||||
fn to_str() -> str { self }
|
||||
}
|
9
src/test/auxiliary/issue_2242_b.rs
Normal file
9
src/test/auxiliary/issue_2242_b.rs
Normal file
@ -0,0 +1,9 @@
|
||||
#[link(name = "b", vers = "0.1")];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
use a;
|
||||
import a::to_str;
|
||||
|
||||
impl of to_str for int {
|
||||
fn to_str() -> str { #fmt("%?", self) }
|
||||
}
|
10
src/test/auxiliary/issue_2242_c.rs
Normal file
10
src/test/auxiliary/issue_2242_c.rs
Normal file
@ -0,0 +1,10 @@
|
||||
#[link(name = "c", vers = "0.1")];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
use a;
|
||||
|
||||
import a::to_str;
|
||||
|
||||
impl of to_str for bool {
|
||||
fn to_str() -> str { #fmt("%b", self) }
|
||||
}
|
17
src/test/run-pass/issue-2242-d.rs
Normal file
17
src/test/run-pass/issue-2242-d.rs
Normal file
@ -0,0 +1,17 @@
|
||||
// xfail-test
|
||||
// aux-build:issue_2242_a.rs
|
||||
// aux-build:issue_2242_b.rs
|
||||
// aux-build:issue_2242_c.rs
|
||||
|
||||
use a;
|
||||
use b;
|
||||
use c;
|
||||
|
||||
import b::to_str;
|
||||
import c::to_str;
|
||||
|
||||
fn main() {
|
||||
io::println("foo".to_str());
|
||||
io::println(1.to_str());
|
||||
io::println(true.to_str());
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user