]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closures/issue-41366.stderr
Fix unused 'mut' warning for capture's root variable
[rust.git] / src / test / ui / closures / issue-41366.stderr
1 error[E0631]: type mismatch in closure arguments
2   --> $DIR/issue-41366.rs:10:5
3    |
4 LL |     (&|_| ()) as &dyn for<'x> Fn(<u32 as T<'x>>::V);
5    |     ^^------^
6    |     | |
7    |     | found signature of `fn(u16) -> _`
8    |     expected signature of `fn(<u32 as T<'x>>::V) -> _`
9    |
10    = note: required for the cast to the object type `dyn for<'x> Fn(<u32 as T<'x>>::V)`
11
12 error[E0277]: the size for values of type `<u32 as T<'_>>::V` cannot be known at compilation time
13   --> $DIR/issue-41366.rs:10:8
14    |
15 LL |     (&|_| ()) as &dyn for<'x> Fn(<u32 as T<'x>>::V);
16    |        ^ doesn't have a size known at compile-time
17    |
18    = help: the trait `Sized` is not implemented for `<u32 as T<'_>>::V`
19    = help: unsized fn params are gated as an unstable feature
20 help: consider further restricting the associated type
21    |
22 LL | fn main() where <u32 as T<'_>>::V: Sized {
23    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24 help: function arguments must have a statically known size, borrowed types always have a known size
25    |
26 LL |     (&|&_| ()) as &dyn for<'x> Fn(<u32 as T<'x>>::V);
27    |        ^
28
29 error: aborting due to 2 previous errors
30
31 Some errors have detailed explanations: E0277, E0631.
32 For more information about an error, try `rustc --explain E0277`.