From edf20ccc1b28a17c5acd1442f6341eb21015a8ea Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 16 Sep 2013 12:02:27 -0700 Subject: [PATCH] testsuite: Add test for #4208 Closes #4208 --- src/test/auxiliary/issue-4208-cc.rs | 21 +++++++++++++++++++++ src/test/run-pass/issue-4208.rs | 19 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/test/auxiliary/issue-4208-cc.rs create mode 100644 src/test/run-pass/issue-4208.rs 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() {}