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