]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-98608.stderr
c5eed7561c0df15452512be0f1de08a0361cc340
[rust.git] / src / test / ui / type-alias-impl-trait / issue-98608.stderr
1 error[E0271]: expected `fn() -> impl Sized {hi}` to be a fn item that returns `Box<u8>`, but it actually returns `impl Sized`
2   --> $DIR/issue-98608.rs:4:39
3    |
4 LL | fn hi() -> impl Sized { std::ptr::null::<u8>() }
5    |            ---------- the found opaque type
6 ...
7 LL |     let b: Box<dyn Fn() -> Box<u8>> = Box::new(hi);
8    |                                       ^^^^^^^^^^^^ expected struct `Box`, found opaque type
9    |
10    = note:   expected struct `Box<u8>`
11            found opaque type `impl Sized`
12    = note: required for the cast from `fn() -> impl Sized {hi}` to the object type `dyn Fn() -> Box<u8>`
13
14 error: aborting due to previous error
15
16 For more information about this error, try `rustc --explain E0271`.