summaryrefslogtreecommitdiffstats
path: root/tests/ui/unsized/return-unsized-from-trait-method.rs
blob: f053f4b0af89c0de9b720c382ea1c910a4341fba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// regression test for #26376

trait Foo {
    fn foo(&self) -> [u8];
}

fn foo(f: Option<&dyn Foo>) {
    if let Some(f) = f {
        let _ = f.foo();
        //~^ ERROR cannot move a value of type `[u8]`
    }
}

fn main() { foo(None) }