2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2013-04-03 05:24:30 -07:00
|
|
|
// Test lifetimes are linked properly when we autoslice a vector.
|
|
|
|
|
// Issue #3148.
|
|
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2015-01-02 17:32:54 -05:00
|
|
|
fn subslice<F>(v: F) -> F where F: FnOnce() { v }
|
2013-04-03 05:24:30 -07:00
|
|
|
|
2015-01-02 17:32:54 -05:00
|
|
|
fn both<F>(v: F) -> F where F: FnOnce() {
|
2013-04-03 05:24:30 -07:00
|
|
|
subslice(subslice(v))
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-25 00:43:37 -07:00
|
|
|
pub fn main() {
|
2013-04-03 05:24:30 -07:00
|
|
|
both(main);
|
|
|
|
|
}
|