rust/tests/ui/unboxed-closures/unboxed-closure-feature-gate.rs

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

21 lines
427 B
Rust
Raw Normal View History

// Check that parenthetical notation is feature-gated except with the
// `Fn` traits.
use std::marker;
trait Foo<A> {
type Output;
fn dummy(&self, a: A) { }
}
fn main() {
2019-05-28 18:46:13 +00:00
let x: Box<dyn Foo(isize)>;
//~^ ERROR parenthetical notation is only stable when used with `Fn`-family
// 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)>;
}