2017-10-30 07:28:07 -05:00
|
|
|
#![allow(warnings)]
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|
|
|
|
|
|
|
|
fn nll_fail() {
|
|
|
|
let mut data = vec!['a', 'b', 'c'];
|
|
|
|
let slice = &mut data;
|
|
|
|
capitalize(slice);
|
|
|
|
data.push('d');
|
2019-05-02 17:34:15 -05:00
|
|
|
//~^ ERROR [E0499]
|
2017-10-30 07:28:07 -05:00
|
|
|
data.push('e');
|
2019-05-02 17:34:15 -05:00
|
|
|
//~^ ERROR [E0499]
|
2017-10-30 07:28:07 -05:00
|
|
|
data.push('f');
|
2019-05-02 17:34:15 -05:00
|
|
|
//~^ ERROR [E0499]
|
2017-10-30 07:28:07 -05:00
|
|
|
capitalize(slice);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn nll_ok() {
|
|
|
|
let mut data = vec!['a', 'b', 'c'];
|
|
|
|
let slice = &mut data;
|
|
|
|
capitalize(slice);
|
|
|
|
data.push('d');
|
|
|
|
data.push('e');
|
|
|
|
data.push('f');
|
|
|
|
}
|
|
|
|
|
|
|
|
fn capitalize(_: &mut [char]) {
|
|
|
|
}
|