1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Check that coercions unify the expected return type of a polymorphic
12 // function call, instead of leaving the type variables as they were.
14 // pretty-expanded FIXME #23616
18 fn foo<T>(self, x: T) -> Option<T> { Some(x) }
22 let _: Option<fn()> = Some(main);
23 let _: Option<fn()> = Foo.foo(main);
25 // The same two cases, with implicit type variables made explicit.
26 let _: Option<fn()> = Some::<_>(main);
27 let _: Option<fn()> = Foo.foo::<_>(main);