]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/issue-98608.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[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 `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 }