rust/src/test/compile-fail/trait-cast.rs

12 lines
357 B
Rust
Raw Normal View History

trait foo<T> { }
fn bar(x: foo<uint>) -> foo<int> {
2012-08-01 17:30:05 -07:00
return (x as foo::<int>);
//~^ ERROR mismatched types: expected `@foo<int>` but found `@foo<uint>`
//~^^ ERROR mismatched types: expected `@foo<int>` but found `@foo<uint>`
// This is unfortunate -- new handling of parens means the error message
// gets printed twice
}
fn main() {}