]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized/return-unsized-from-trait-method.rs
Merge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyup
[rust.git] / src / test / ui / unsized / return-unsized-from-trait-method.rs
1 // regression test for #26376
2
3 trait Foo {
4     fn foo(&self) -> [u8];
5 }
6
7 fn foo(f: Option<&dyn Foo>) {
8     if let Some(f) = f {
9         let _ = f.foo();
10         //~^ ERROR cannot move a value of type [u8]: the size of [u8] cannot be statically determined
11     }
12 }
13
14 fn main() { foo(None) }