blob: bbf7ba79e2a64654ce2018d24a8853c12b525f7f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// run-pass
fn foo(x: &[isize]) -> isize {
x[0]
}
pub fn main() {
let p = vec![1,2,3,4,5];
let r = foo(&p);
assert_eq!(r, 1);
let p = vec![5,4,3,2,1];
let r = foo(&p);
assert_eq!(r, 5);
}
|