2015-08-05 15:10:45 +02:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
|
|
|
|
|
|
|
#![deny(string_add_assign)]
|
2015-08-12 15:50:56 +02:00
|
|
|
#![deny(string_add)]
|
2015-08-05 15:10:45 +02:00
|
|
|
fn main() {
|
2015-08-12 15:50:56 +02:00
|
|
|
let mut x = "".to_owned();
|
2015-08-11 20:22:20 +02:00
|
|
|
|
2015-08-12 15:50:56 +02:00
|
|
|
for _ in (1..3) {
|
|
|
|
x = x + "."; //~ERROR you assign the result of adding something to this string.
|
2015-08-11 20:22:20 +02:00
|
|
|
}
|
2015-08-12 15:50:56 +02:00
|
|
|
|
|
|
|
let y = "".to_owned();
|
|
|
|
let z = y + "..."; //~ERROR you add something to a string.
|
|
|
|
|
|
|
|
assert_eq!(&x, &z);
|
2015-08-05 15:10:45 +02:00
|
|
|
}
|