]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | // Check that parenthetical notation is feature-gated except with the |
2 | // `Fn` traits. | |
223e47cc | 3 | |
85aaf69f SL |
4 | use std::marker; |
5 | ||
6 | trait Foo<A> { | |
7 | type Output; | |
8 | ||
9 | fn dummy(&self, a: A) { } | |
223e47cc LB |
10 | } |
11 | ||
12 | fn main() { | |
dc9dc135 | 13 | let x: Box<dyn Foo(isize)>; |
c1a9b12d | 14 | //~^ ERROR parenthetical notation is only stable when used with `Fn`-family |
1a4d82fc JJ |
15 | |
16 | // No errors with these: | |
dc9dc135 XL |
17 | let x: Box<dyn Fn(isize)>; |
18 | let x: Box<dyn FnMut(isize)>; | |
19 | let x: Box<dyn FnOnce(isize)>; | |
223e47cc | 20 | } |