rust/tests/ui/traits/early-vtbl-resolution.rs

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

20 lines
363 B
Rust
Raw Normal View History

//@ run-pass
#![allow(non_camel_case_types)]
#![allow(dead_code)]
//@ pretty-expanded FIXME #23616
trait thing<A> {
fn foo(&self) -> Option<A>;
}
impl<A> thing<A> for isize {
fn foo(&self) -> Option<A> { None }
}
2012-08-20 19:23:37 +00:00
fn foo_func<A, B: thing<A>>(x: B) -> Option<A> { x.foo() }
struct A { a: isize }
pub fn main() {
2015-01-25 21:05:03 +00:00
let _x: Option<f64> = foo_func(0);
}