]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized/return-unsized-from-trait-method.rs
Rollup merge of #98665 - ChrisDenton:deprecated-suggestion, r=compiler-errors
[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) }