diff --git a/src/test/auxiliary/issue-4208-cc.rs b/src/test/auxiliary/issue-4208-cc.rs new file mode 100644 index 0000000000000..26db69fb9e17f --- /dev/null +++ b/src/test/auxiliary/issue-4208-cc.rs @@ -0,0 +1,21 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[link(name = "numeric", + vers = "0.1")]; +#[crate_type = "lib"]; + +pub trait Trig { + fn sin(&self) -> T; +} + +pub fn sin, R>(theta: &T) -> R { theta.sin() } + +pub trait Angle: Trig {} diff --git a/src/test/run-pass/issue-4208.rs b/src/test/run-pass/issue-4208.rs new file mode 100644 index 0000000000000..e8b633ca251f3 --- /dev/null +++ b/src/test/run-pass/issue-4208.rs @@ -0,0 +1,19 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:issue-4208-cc.rs +// xfail-fast - Windows hates cross-crate tests + +extern mod numeric; +use numeric::*; + +fn foo>(theta: A) -> T { sin(&theta) } + +fn main() {}