]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-20225.stderr
Consider privacy more carefully when suggesting accessing fields
[rust.git] / src / test / ui / issues / issue-20225.stderr
1 error[E0053]: method `call` has an incompatible type for trait
2   --> $DIR/issue-20225.rs:6:43
3    |
4 LL | impl<'a, T> Fn<(&'a T,)> for Foo {
5    |          - this type parameter
6 LL |   extern "rust-call" fn call(&self, (_,): (T,)) {}
7    |                                           ^^^^
8    |                                           |
9    |                                           expected `&T`, found type parameter `T`
10    |                                           help: change the parameter type to match the trait: `(&'a T,)`
11    |
12    = note: expected fn pointer `extern "rust-call" fn(&Foo, (&'a T,))`
13               found fn pointer `extern "rust-call" fn(&Foo, (T,))`
14
15 error[E0053]: method `call_mut` has an incompatible type for trait
16   --> $DIR/issue-20225.rs:11:51
17    |
18 LL | impl<'a, T> FnMut<(&'a T,)> for Foo {
19    |          - this type parameter
20 LL |   extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
21    |                                                   ^^^^
22    |                                                   |
23    |                                                   expected `&T`, found type parameter `T`
24    |                                                   help: change the parameter type to match the trait: `(&'a T,)`
25    |
26    = note: expected fn pointer `extern "rust-call" fn(&mut Foo, (&'a T,))`
27               found fn pointer `extern "rust-call" fn(&mut Foo, (T,))`
28
29 error[E0053]: method `call_once` has an incompatible type for trait
30   --> $DIR/issue-20225.rs:18:47
31    |
32 LL | impl<'a, T> FnOnce<(&'a T,)> for Foo {
33    |          - this type parameter
34 ...
35 LL |   extern "rust-call" fn call_once(self, (_,): (T,)) {}
36    |                                               ^^^^
37    |                                               |
38    |                                               expected `&T`, found type parameter `T`
39    |                                               help: change the parameter type to match the trait: `(&'a T,)`
40    |
41    = note: expected fn pointer `extern "rust-call" fn(Foo, (&'a T,))`
42               found fn pointer `extern "rust-call" fn(Foo, (T,))`
43
44 error: aborting due to 3 previous errors
45
46 For more information about this error, try `rustc --explain E0053`.