]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/issue-98608.rs
Rollup merge of #107325 - petrochenkov:hiddoc2, r=GuillaumeGomez
[rust.git] / tests / ui / type-alias-impl-trait / issue-98608.rs
1 fn hi() -> impl Sized {
2     std::ptr::null::<u8>()
3 }
4
5 fn main() {
6     let b: Box<dyn Fn() -> Box<u8>> = Box::new(hi);
7     //~^ ERROR expected `fn() -> impl Sized {hi}` to be a fn item that returns `Box<u8>`, but it returns `impl Sized`
8     let boxed = b();
9     let null = *boxed;
10     println!("{null:?}");
11 }