Skip to content

Instantly share code, notes, and snippets.

@thomaslee
Last active December 17, 2015 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomaslee/5522568 to your computer and use it in GitHub Desktop.
Save thomaslee/5522568 to your computer and use it in GitHub Desktop.
Updated reproduction of the issue described in Rust issue #4202
extern mod foo;
use foo::Foo;
use foo::Bar;
fn main() {
assert!(42 == Bar::bar());
assert!(42 == Foo::foo());
}
#[link(name = "foo", vers = "0.1")];
#[crate_type = "lib"];
pub use sub_foo::Foo;
pub trait Bar {
pub fn bar() -> Self;
}
impl Bar for int {
pub fn bar() -> int { 42 }
}
mod sub_foo {
pub trait Foo {
pub fn foo() -> Self;
}
impl Foo for int {
pub fn foo() -> int { 42 }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment