// 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. pub fn main() { let _id: &Mat2 = &Matrix::identity(); } pub trait Index { } pub trait Dimensional: Index { } pub struct Mat2 { x: () } pub struct Vec2 { x: () } impl Dimensional> for Mat2 { } impl Index> for Mat2 { } impl Dimensional for Vec2 { } impl Index for Vec2 { } pub trait Matrix: Dimensional { fn identity() -> Self; } impl Matrix> for Mat2 { fn identity() -> Mat2 { Mat2{ x: () } } }