]>
Commit | Line | Data |
---|---|---|
8faf50e0 | 1 | error[E0053]: method `call` has an incompatible type for trait |
0731742a | 2 | --> $DIR/issue-20225.rs:6:3 |
8faf50e0 | 3 | | |
60c5eb7d XL |
4 | LL | impl<'a, T> Fn<(&'a T,)> for Foo { |
5 | | - this type parameter | |
8faf50e0 | 6 | LL | extern "rust-call" fn call(&self, (_,): (T,)) {} |
60c5eb7d | 7 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&T`, found type parameter `T` |
8faf50e0 | 8 | | |
60c5eb7d XL |
9 | = note: expected fn pointer `extern "rust-call" fn(&Foo, (&'a T,))` |
10 | found fn pointer `extern "rust-call" fn(&Foo, (T,))` | |
e1599b0c XL |
11 | = help: type parameters must be constrained to match other types |
12 | = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters | |
8faf50e0 XL |
13 | |
14 | error[E0053]: method `call_mut` has an incompatible type for trait | |
60c5eb7d | 15 | --> $DIR/issue-20225.rs:11:3 |
8faf50e0 | 16 | | |
60c5eb7d XL |
17 | LL | impl<'a, T> FnMut<(&'a T,)> for Foo { |
18 | | - this type parameter | |
8faf50e0 | 19 | LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} |
60c5eb7d | 20 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&T`, found type parameter `T` |
8faf50e0 | 21 | | |
60c5eb7d XL |
22 | = note: expected fn pointer `extern "rust-call" fn(&mut Foo, (&'a T,))` |
23 | found fn pointer `extern "rust-call" fn(&mut Foo, (T,))` | |
e1599b0c XL |
24 | = help: type parameters must be constrained to match other types |
25 | = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters | |
8faf50e0 XL |
26 | |
27 | error[E0053]: method `call_once` has an incompatible type for trait | |
60c5eb7d | 28 | --> $DIR/issue-20225.rs:18:3 |
8faf50e0 | 29 | | |
60c5eb7d XL |
30 | LL | impl<'a, T> FnOnce<(&'a T,)> for Foo { |
31 | | - this type parameter | |
32 | ... | |
8faf50e0 | 33 | LL | extern "rust-call" fn call_once(self, (_,): (T,)) {} |
60c5eb7d | 34 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&T`, found type parameter `T` |
8faf50e0 | 35 | | |
60c5eb7d XL |
36 | = note: expected fn pointer `extern "rust-call" fn(Foo, (&'a T,))` |
37 | found fn pointer `extern "rust-call" fn(Foo, (T,))` | |
e1599b0c XL |
38 | = help: type parameters must be constrained to match other types |
39 | = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters | |
8faf50e0 XL |
40 | |
41 | error: aborting due to 3 previous errors | |
42 | ||
43 | For more information about this error, try `rustc --explain E0053`. |