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