]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized/return-unsized-from-trait-method.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[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]`
11     }
12 }
13
14 fn main() { foo(None) }