summaryrefslogtreecommitdiffstats
path: root/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.rs
blob: 79ced1ecfb1a04734b4825a2afa6f79356cf76d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Test that parentheses form parses in expression paths.

struct Bar<A,R> {
    f: A, r: R
}

impl<A,B> Bar<A,B> {
    fn new() -> Bar<A,B> { panic!() }
}

fn bar() {
    let b = Bar::<isize, usize>::new(); // OK

    let b = Bar::(isize, usize)::new(); // OK too (for the parser)
    //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
}

fn main() {}