]> git.lizzy.rs Git - rust.git/blob - src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.rs
parser will not give wrong help message for 'public'
[rust.git] / src / test / ui / feature-gates / feature-gate-unboxed-closures-manual-impls.rs
1 // Test that manual impls of the `Fn` traits are not possible without
2 // a feature gate. In fact, the specialized check for these cases
3 // never triggers (yet), because they encounter other problems around
4 // angle bracket vs parentheses notation.
5
6 #![feature(fn_traits)]
7
8 struct Foo;
9 impl Fn<()> for Foo {
10 //~^ ERROR the precise format of `Fn`-family traits' type parameters is subject to change
11 //~| ERROR manual implementations of `Fn` are experimental
12     extern "rust-call" fn call(self, args: ()) -> () {}
13     //~^ ERROR rust-call ABI is subject to change
14 }
15 struct Foo1;
16 impl FnOnce() for Foo1 {
17 //~^ ERROR associated type bindings are not allowed here
18 //~| ERROR manual implementations of `FnOnce` are experimental
19     extern "rust-call" fn call_once(self, args: ()) -> () {}
20     //~^ ERROR rust-call ABI is subject to change
21 }
22 struct Bar;
23 impl FnMut<()> for Bar {
24 //~^ ERROR the precise format of `Fn`-family traits' type parameters is subject to change
25 //~| ERROR manual implementations of `FnMut` are experimental
26     extern "rust-call" fn call_mut(&self, args: ()) -> () {}
27     //~^ ERROR rust-call ABI is subject to change
28 }
29 struct Baz;
30 impl FnOnce<()> for Baz {
31 //~^ ERROR the precise format of `Fn`-family traits' type parameters is subject to change
32 //~| ERROR manual implementations of `FnOnce` are experimental
33     extern "rust-call" fn call_once(&self, args: ()) -> () {}
34     //~^ ERROR rust-call ABI is subject to change
35 }
36
37 fn main() {}