2019-07-27 00:54:25 +03:00
|
|
|
// run-pass
|
|
|
|
|
2018-09-14 12:20:28 +02:00
|
|
|
#![allow(non_camel_case_types)]
|
|
|
|
#![allow(dead_code)]
|
2015-03-22 13:13:15 -07:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2012-08-20 18:47:16 -07:00
|
|
|
trait thing<A> {
|
2013-03-12 19:32:14 -07:00
|
|
|
fn foo(&self) -> Option<A>;
|
2012-08-20 18:47:16 -07:00
|
|
|
}
|
2015-03-25 17:06:52 -07:00
|
|
|
impl<A> thing<A> for isize {
|
2013-03-12 19:32:14 -07:00
|
|
|
fn foo(&self) -> Option<A> { None }
|
2012-08-20 18:47:16 -07:00
|
|
|
}
|
2012-08-20 12:23:37 -07:00
|
|
|
fn foo_func<A, B: thing<A>>(x: B) -> Option<A> { x.foo() }
|
2012-08-20 18:47:16 -07:00
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
struct A { a: isize }
|
2013-01-25 22:46:32 -08:00
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2015-01-25 22:05:03 +01:00
|
|
|
let _x: Option<f64> = foo_func(0);
|
2012-08-20 18:47:16 -07:00
|
|
|
}
|