summaryrefslogtreecommitdiffstats
path: root/tests/ui/self/arbitrary_self_types_unsized_struct.rs
blob: d43f3132890b5ead536e23122d48d4022185f2f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-pass

use std::rc::Rc;

struct Foo<T: ?Sized>(T);

impl Foo<[u8]> {
    fn len(self: Rc<Self>) -> usize {
        self.0.len()
    }
}

fn main() {
    let rc = Rc::new(Foo([1u8,2,3])) as Rc<Foo<[u8]>>;
    assert_eq!(3, rc.len());
}