summaryrefslogtreecommitdiffstats
path: root/tests/ui/unboxed-closures/unboxed-closures-call-sugar-autoderef.rs
blob: 9b8a3f4098cdb0a6dbf4fde23345c3bb2b24b009 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass
// Test that the call operator autoderefs when calling a bounded type parameter.

use std::ops::FnMut;

fn call_with_2<F>(x: &mut F) -> isize
    where F : FnMut(isize) -> isize
{
    x(2) // look ma, no `*`
}

pub fn main() {
    let z = call_with_2(&mut |x| x - 22);
    assert_eq!(z, -20);
}