rust/tests/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
378 B
Rust
Raw Normal View History

2017-07-28 20:47:12 -05:00
// 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() {
2017-07-28 20:47:12 -05:00
let b = Bar::<isize, usize>::new(); // OK
2017-07-28 20:47:12 -05:00
let b = Bar::(isize, usize)::new(); // OK too (for the parser)
//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
}
2017-07-28 20:47:12 -05:00
fn main() {}