]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/string_add.rs
Auto merge of #74777 - ssomers:btree_cleanup_7, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / string_add.rs
1 // aux-build:macro_rules.rs
2
3 #[macro_use]
4 extern crate macro_rules;
5
6 #[warn(clippy::string_add)]
7 #[allow(clippy::string_add_assign, unused)]
8 fn main() {
9     // ignores assignment distinction
10     let mut x = "".to_owned();
11
12     for _ in 1..3 {
13         x = x + ".";
14     }
15
16     let y = "".to_owned();
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     string_add!();
26 }