2017-10-30 12:28:07 +00: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 22:34:15 +00:00
|
|
|
//~^ ERROR [E0499]
|
2017-10-30 12:28:07 +00:00
|
|
|
data.push('e');
|
2019-05-02 22:34:15 +00:00
|
|
|
//~^ ERROR [E0499]
|
2017-10-30 12:28:07 +00:00
|
|
|
data.push('f');
|
2019-05-02 22:34:15 +00:00
|
|
|
//~^ ERROR [E0499]
|
2017-10-30 12:28:07 +00: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]) {
|
|
|
|
}
|