summaryrefslogtreecommitdiffstats
path: root/tests/ui/autoref-autoderef/auto-ref-sliceable.rs
blob: e5f79d78051185bb7c8e8694afe62fc2bee44a05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// run-pass


trait Pushable<T> {
    fn push_val(&mut self, t: T);
}

impl<T> Pushable<T> for Vec<T> {
    fn push_val(&mut self, t: T) {
        self.push(t);
    }
}

pub fn main() {
    let mut v = vec![1];
    v.push_val(2);
    v.push_val(3);
    assert_eq!(v, [1, 2, 3]);
}