blob: bf3cc04cdc2272dd5e72d5f4e46f183984984c18 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
//@ run-pass
#![allow(non_camel_case_types)]
#![allow(dead_code)]
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);
}
|