rust/src/test/ui/issues/issue-14382.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
283 B
Rust
Raw Normal View History

// run-pass
2015-07-20 17:31:04 +00:00
#[derive(Debug)]
struct Matrix4<S>(S);
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);
}