]> git.proxmox.com Git - rustc.git/blob - src/test/ui/unsized/return-unsized-from-trait-method.rs
New upstream version 1.45.0+dfsg1
[rustc.git] / src / test / ui / unsized / return-unsized-from-trait-method.rs
1 // ignore-tidy-linelength
2
3 // regression test for #26376
4
5 trait Foo {
6 fn foo(&self) -> [u8];
7 }
8
9 fn foo(f: Option<&dyn Foo>) {
10 if let Some(f) = f {
11 let _ = f.foo();
12 //~^ ERROR cannot move a value of type [u8]: the size of [u8] cannot be statically determined
13 }
14 }
15
16 fn main() { foo(None) }