]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/swap.stderr
Auto merge of #97944 - nikic:freebsd-update, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / swap.stderr
1 error: this looks like you are swapping `bar.a` and `bar.b` manually
2   --> $DIR/swap.rs:24:5
3    |
4 LL | /     let temp = bar.a;
5 LL | |     bar.a = bar.b;
6 LL | |     bar.b = temp;
7    | |________________^ help: try: `std::mem::swap(&mut bar.a, &mut bar.b)`
8    |
9    = note: `-D clippy::manual-swap` implied by `-D warnings`
10    = note: or maybe you should use `std::mem::replace`?
11
12 error: this looks like you are swapping elements of `foo` manually
13   --> $DIR/swap.rs:36:5
14    |
15 LL | /     let temp = foo[0];
16 LL | |     foo[0] = foo[1];
17 LL | |     foo[1] = temp;
18    | |_________________^ help: try: `foo.swap(0, 1)`
19
20 error: this looks like you are swapping elements of `foo` manually
21   --> $DIR/swap.rs:45:5
22    |
23 LL | /     let temp = foo[0];
24 LL | |     foo[0] = foo[1];
25 LL | |     foo[1] = temp;
26    | |_________________^ help: try: `foo.swap(0, 1)`
27
28 error: this looks like you are swapping elements of `foo` manually
29   --> $DIR/swap.rs:64:5
30    |
31 LL | /     let temp = foo[0];
32 LL | |     foo[0] = foo[1];
33 LL | |     foo[1] = temp;
34    | |_________________^ help: try: `foo.swap(0, 1)`
35
36 error: this looks like you are swapping `a` and `b` manually
37   --> $DIR/swap.rs:75:5
38    |
39 LL | /     a ^= b;
40 LL | |     b ^= a;
41 LL | |     a ^= b;
42    | |___________^ help: try: `std::mem::swap(&mut a, &mut b)`
43
44 error: this looks like you are swapping `bar.a` and `bar.b` manually
45   --> $DIR/swap.rs:83:5
46    |
47 LL | /     bar.a ^= bar.b;
48 LL | |     bar.b ^= bar.a;
49 LL | |     bar.a ^= bar.b;
50    | |___________________^ help: try: `std::mem::swap(&mut bar.a, &mut bar.b)`
51
52 error: this looks like you are swapping elements of `foo` manually
53   --> $DIR/swap.rs:91:5
54    |
55 LL | /     foo[0] ^= foo[1];
56 LL | |     foo[1] ^= foo[0];
57 LL | |     foo[0] ^= foo[1];
58    | |_____________________^ help: try: `foo.swap(0, 1)`
59
60 error: this looks like you are swapping `foo[0][1]` and `bar[1][0]` manually
61   --> $DIR/swap.rs:120:5
62    |
63 LL | /     let temp = foo[0][1];
64 LL | |     foo[0][1] = bar[1][0];
65 LL | |     bar[1][0] = temp;
66    | |____________________^ help: try: `std::mem::swap(&mut foo[0][1], &mut bar[1][0])`
67    |
68    = note: or maybe you should use `std::mem::replace`?
69
70 error: this looks like you are swapping `a` and `b` manually
71   --> $DIR/swap.rs:134:7
72    |
73 LL |       ; let t = a;
74    |  _______^
75 LL | |     a = b;
76 LL | |     b = t;
77    | |_________^ help: try: `std::mem::swap(&mut a, &mut b)`
78    |
79    = note: or maybe you should use `std::mem::replace`?
80
81 error: this looks like you are swapping `c.0` and `a` manually
82   --> $DIR/swap.rs:143:7
83    |
84 LL |       ; let t = c.0;
85    |  _______^
86 LL | |     c.0 = a;
87 LL | |     a = t;
88    | |_________^ help: try: `std::mem::swap(&mut c.0, &mut a)`
89    |
90    = note: or maybe you should use `std::mem::replace`?
91
92 error: this looks like you are trying to swap `a` and `b`
93   --> $DIR/swap.rs:131:5
94    |
95 LL | /     a = b;
96 LL | |     b = a;
97    | |_________^ help: try: `std::mem::swap(&mut a, &mut b)`
98    |
99    = note: `-D clippy::almost-swapped` implied by `-D warnings`
100    = note: or maybe you should use `std::mem::replace`?
101
102 error: this looks like you are trying to swap `c.0` and `a`
103   --> $DIR/swap.rs:140:5
104    |
105 LL | /     c.0 = a;
106 LL | |     a = c.0;
107    | |___________^ help: try: `std::mem::swap(&mut c.0, &mut a)`
108    |
109    = note: or maybe you should use `std::mem::replace`?
110
111 error: this looks like you are swapping `s.0.x` and `s.0.y` manually
112   --> $DIR/swap.rs:178:5
113    |
114 LL | /     let t = s.0.x;
115 LL | |     s.0.x = s.0.y;
116 LL | |     s.0.y = t;
117    | |_____________^ help: try: `std::mem::swap(&mut s.0.x, &mut s.0.y)`
118    |
119    = note: or maybe you should use `std::mem::replace`?
120
121 error: aborting due to 13 previous errors
122