2014-11-26 08:12:18 -05:00
|
|
|
// Check that parenthetical notation is feature-gated except with the
|
|
|
|
// `Fn` traits.
|
2012-07-27 14:51:46 -07:00
|
|
|
|
2015-02-12 10:29:52 -05:00
|
|
|
use std::marker;
|
|
|
|
|
2015-01-12 10:27:25 -05:00
|
|
|
trait Foo<A> {
|
|
|
|
type Output;
|
2015-02-12 10:29:52 -05:00
|
|
|
|
|
|
|
fn dummy(&self, a: A) { }
|
2014-11-26 08:12:18 -05:00
|
|
|
}
|
2012-07-27 14:51:46 -07:00
|
|
|
|
|
|
|
fn main() {
|
2019-05-28 14:46:13 -04:00
|
|
|
let x: Box<dyn Foo(isize)>;
|
2015-07-28 19:21:24 +03:00
|
|
|
//~^ ERROR parenthetical notation is only stable when used with `Fn`-family
|
2014-11-26 08:12:18 -05:00
|
|
|
|
|
|
|
// No errors with these:
|
2019-05-28 14:46:13 -04:00
|
|
|
let x: Box<dyn Fn(isize)>;
|
|
|
|
let x: Box<dyn FnMut(isize)>;
|
|
|
|
let x: Box<dyn FnOnce(isize)>;
|
2013-02-14 11:47:00 -08:00
|
|
|
}
|