1 //@aux-build:proc_macros.rs:proc-macro 2 3 extern crate proc_macros; 4 use proc_macros::external; 5 6 #[warn(clippy::string_add)] 7 #[allow(clippy::string_add_assign, unused)] main()8fn main() { 9 // ignores assignment distinction 10 let mut x = String::new(); 11 12 for _ in 1..3 { 13 x = x + "."; 14 } 15 16 let y = String::new(); 17 let z = y + "..."; 18 19 assert_eq!(&x, &z); 20 21 let mut x = 1; 22 x = x + 1; 23 assert_eq!(2, x); 24 25 external!({ 26 let y = "".to_owned(); 27 let z = y + "..."; 28 }); 29 } 30