diff options
| author | bors <bors@rust-lang.org> | 2013-09-16 21:15:51 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-09-16 21:15:51 -0700 |
| commit | b75e07501b8a68bc2acf61d506d5b21498448c0c (patch) | |
| tree | 3b6c839d110c5fe0f87c971c63a1f4e2c9cdf554 | |
| parent | d5e9033a0d380fefb5610c97ff1048c809251bba (diff) | |
| parent | edf20ccc1b28a17c5acd1442f6341eb21015a8ea (diff) | |
| download | rust-b75e07501b8a68bc2acf61d506d5b21498448c0c.tar.gz rust-b75e07501b8a68bc2acf61d506d5b21498448c0c.zip | |
auto merge of #9233 : catamorphism/rust/issue-4208, r=catamorphism
Closes #4208
| -rw-r--r-- | src/test/auxiliary/issue-4208-cc.rs | 21 | ||||
| -rw-r--r-- | src/test/run-pass/issue-4208.rs | 19 |
2 files changed, 40 insertions, 0 deletions
diff --git a/src/test/auxiliary/issue-4208-cc.rs b/src/test/auxiliary/issue-4208-cc.rs new file mode 100644 index 00000000000..26db69fb9e1 --- /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 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T> { + fn sin(&self) -> T; +} + +pub fn sin<T:Trig<R>, R>(theta: &T) -> R { theta.sin() } + +pub trait Angle<T>: Trig<T> {} diff --git a/src/test/run-pass/issue-4208.rs b/src/test/run-pass/issue-4208.rs new file mode 100644 index 00000000000..e8b633ca251 --- /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 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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<T, A:Angle<T>>(theta: A) -> T { sin(&theta) } + +fn main() {} |
