2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2015-07-20 12:31:04 -05:00
|
|
|
#[derive(Debug)]
|
2022-07-25 15:36:03 -05:00
|
|
|
struct Matrix4<S>(#[allow(unused_tuple_struct_fields)] S);
|
2015-07-20 12:31:04 -05:00
|
|
|
trait POrd<S> {}
|
|
|
|
|
|
|
|
fn translate<S: POrd<S>>(s: S) -> Matrix4<S> { Matrix4(s) }
|
|
|
|
|
|
|
|
impl POrd<f32> for f32 {}
|
|
|
|
impl POrd<f64> for f64 {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = 1.0;
|
|
|
|
let m : Matrix4<f32> = translate(x);
|
|
|
|
println!("m: {:?}", m);
|
|
|
|
}
|