]> git.lizzy.rs Git - rust.git/blob - tests/ui/unboxed-closures/unboxed-closure-feature-gate.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / unboxed-closures / unboxed-closure-feature-gate.rs
1 // Check that parenthetical notation is feature-gated except with the
2 // `Fn` traits.
3
4 use std::marker;
5
6 trait Foo<A> {
7     type Output;
8
9     fn dummy(&self, a: A) { }
10 }
11
12 fn main() {
13     let x: Box<dyn Foo(isize)>;
14     //~^ ERROR parenthetical notation is only stable when used with `Fn`-family
15
16     // No errors with these:
17     let x: Box<dyn Fn(isize)>;
18     let x: Box<dyn FnMut(isize)>;
19     let x: Box<dyn FnOnce(isize)>;
20 }