]> git.lizzy.rs Git - rust.git/blob - tests/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.rs
Auto merge of #107054 - petrochenkov:effvisdoc3, r=GuillaumeGomez
[rust.git] / tests / ui / unboxed-closures / unboxed-closure-sugar-used-on-struct-3.rs
1 // Test that parentheses form parses in expression paths.
2
3 struct Bar<A,R> {
4     f: A, r: R
5 }
6
7 impl<A,B> Bar<A,B> {
8     fn new() -> Bar<A,B> { panic!() }
9 }
10
11 fn bar() {
12     let b = Bar::<isize, usize>::new(); // OK
13
14     let b = Bar::(isize, usize)::new(); // OK too (for the parser)
15     //~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
16 }
17
18 fn main() {}