]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.rs
Merge commit '370c397ec9169809e5ad270079712e0043514240' into sync_cg_clif-2022-03-20
[rust.git] / src / test / 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() {}