Allow closure arguments types to unify even if we can't fully resolve
a trait obligation. Partial fix for #16440 -- closure return types are not handled yet.
This commit is contained in:
parent
3d072a193b
commit
c9e1c445db
2 changed files with 63 additions and 22 deletions
|
|
@ -14,6 +14,6 @@ fn foo(i: int) -> int { i + 1 }
|
|||
fn apply<A, F>(f: F, v: A) -> A where F: FnOnce(A) -> A { f(v) }
|
||||
|
||||
pub fn main() {
|
||||
let f = {|: i| foo(i)};
|
||||
let f = {|i| foo(i)};
|
||||
assert_eq!(apply(f, 2), 3);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue