rust/src/test/ui/early-vtbl-resolution.rs
2019-07-27 18:56:16 +03:00

20 lines
361 B
Rust

// 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 }
}
fn foo_func<A, B: thing<A>>(x: B) -> Option<A> { x.foo() }
struct A { a: isize }
pub fn main() {
let _x: Option<f64> = foo_func(0);
}