summary refs log tree commit diff
path: root/src/test/run-pass/issue-4107.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-19 18:36:59 +0000
committerbors <bors@rust-lang.org>2015-02-19 18:36:59 +0000
commit522d09dfecbeca1595f25ac58c6d0178bbd21d7d (patch)
treecc0252dd3413e5f890d0ebcfdaa096e5b002be0b /src/test/run-pass/issue-4107.rs
parent0b664bb8436f2cfda7f13a6f302ab486f332816f (diff)
parent49771bafa5fca16486bfd06741dac3de2c587adf (diff)
downloadrust-1.0.0-alpha.2.tar.gz
rust-1.0.0-alpha.2.zip
Auto merge of #22541 - Manishearth:rollup, r=Gankro 1.0.0-alpha.2
Continued from #22520
Diffstat (limited to 'src/test/run-pass/issue-4107.rs')
-rw-r--r--src/test/run-pass/issue-4107.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/run-pass/issue-4107.rs b/src/test/run-pass/issue-4107.rs
index 2ed662e9f2d..d660f300ada 100644
--- a/src/test/run-pass/issue-4107.rs
+++ b/src/test/run-pass/issue-4107.rs
@@ -9,14 +9,14 @@
 // except according to those terms.
 
 pub fn main() {
-    let _id: &Mat2<f64> = &Matrix::identity();
+    let _id: &Mat2<f64> = &Matrix::identity(1.0);
 }
 
-pub trait Index<Index,Result> { }
+pub trait Index<Index,Result> { fn get(&self, Index) -> Result { panic!() } }
 pub trait Dimensional<T>: Index<uint, T> { }
 
-pub struct Mat2<T> { x: () }
-pub struct Vec2<T> { x: () }
+pub struct Mat2<T> { x: T }
+pub struct Vec2<T> { x: T }
 
 impl<T> Dimensional<Vec2<T>> for Mat2<T> { }
 impl<T> Index<uint, Vec2<T>> for Mat2<T> { }
@@ -25,9 +25,9 @@ impl<T> Dimensional<T> for Vec2<T> { }
 impl<T> Index<uint, T> for Vec2<T> { }
 
 pub trait Matrix<T,V>: Dimensional<V> {
-    fn identity() -> Self;
+    fn identity(t:T) -> Self;
 }
 
 impl<T> Matrix<T, Vec2<T>> for Mat2<T> {
-    fn identity() -> Mat2<T> { Mat2{ x: () } }
+    fn identity(t:T) -> Mat2<T> { Mat2{ x: t } }
 }