fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
4.7 KiB161 linesraw
1error: this looks like you are swapping `bar.a` and `bar.b` manually
2  --> $DIR/swap.rs:28:5
3   |
4LL | /     let temp = bar.a;
5LL | |     bar.a = bar.b;
6LL | |     bar.b = temp;
7   | |_________________^ help: try: `std::mem::swap(&mut bar.a, &mut bar.b);`
8   |
9   = note: or maybe you should use `std::mem::replace`?
10   = note: `-D clippy::manual-swap` implied by `-D warnings`
11   = help: to override `-D warnings` add `#[allow(clippy::manual_swap)]`
12
13error: this looks like you are swapping elements of `foo` manually
14  --> $DIR/swap.rs:40:5
15   |
16LL | /     let temp = foo[0];
17LL | |     foo[0] = foo[1];
18LL | |     foo[1] = temp;
19   | |__________________^ help: try: `foo.swap(0, 1);`
20
21error: this looks like you are swapping elements of `foo` manually
22  --> $DIR/swap.rs:49:5
23   |
24LL | /     let temp = foo[0];
25LL | |     foo[0] = foo[1];
26LL | |     foo[1] = temp;
27   | |__________________^ help: try: `foo.swap(0, 1);`
28
29error: this looks like you are swapping elements of `foo` manually
30  --> $DIR/swap.rs:68:5
31   |
32LL | /     let temp = foo[0];
33LL | |     foo[0] = foo[1];
34LL | |     foo[1] = temp;
35   | |__________________^ help: try: `foo.swap(0, 1);`
36
37error: this looks like you are swapping `a` and `b` manually
38  --> $DIR/swap.rs:79:5
39   |
40LL | /     a ^= b;
41LL | |     b ^= a;
42LL | |     a ^= b;
43   | |___________^ help: try: `std::mem::swap(&mut a, &mut b);`
44
45error: this looks like you are swapping `bar.a` and `bar.b` manually
46  --> $DIR/swap.rs:87:5
47   |
48LL | /     bar.a ^= bar.b;
49LL | |     bar.b ^= bar.a;
50LL | |     bar.a ^= bar.b;
51   | |___________________^ help: try: `std::mem::swap(&mut bar.a, &mut bar.b);`
52
53error: this looks like you are swapping elements of `foo` manually
54  --> $DIR/swap.rs:95:5
55   |
56LL | /     foo[0] ^= foo[1];
57LL | |     foo[1] ^= foo[0];
58LL | |     foo[0] ^= foo[1];
59   | |_____________________^ help: try: `foo.swap(0, 1);`
60
61error: this looks like you are swapping `foo[0][1]` and `bar[1][0]` manually
62  --> $DIR/swap.rs:124:5
63   |
64LL | /     let temp = foo[0][1];
65LL | |     foo[0][1] = bar[1][0];
66LL | |     bar[1][0] = temp;
67   | |_____________________^ help: try: `std::mem::swap(&mut foo[0][1], &mut bar[1][0]);`
68   |
69   = note: or maybe you should use `std::mem::replace`?
70
71error: this looks like you are swapping `a` and `b` manually
72  --> $DIR/swap.rs:138:7
73   |
74LL |       ; let t = a;
75   |  _______^
76LL | |     a = b;
77LL | |     b = t;
78   | |__________^ help: try: `std::mem::swap(&mut a, &mut b);`
79   |
80   = note: or maybe you should use `std::mem::replace`?
81
82error: this looks like you are swapping `c.0` and `a` manually
83  --> $DIR/swap.rs:147:7
84   |
85LL |       ; let t = c.0;
86   |  _______^
87LL | |     c.0 = a;
88LL | |     a = t;
89   | |__________^ help: try: `std::mem::swap(&mut c.0, &mut a);`
90   |
91   = note: or maybe you should use `std::mem::replace`?
92
93error: this looks like you are swapping `b` and `a` manually
94  --> $DIR/swap.rs:173:5
95   |
96LL | /     let t = b;
97LL | |     b = a;
98LL | |     a = t;
99   | |__________^ help: try: `std::mem::swap(&mut b, &mut a);`
100   |
101   = note: or maybe you should use `std::mem::replace`?
102
103error: this looks like you are trying to swap `a` and `b`
104  --> $DIR/swap.rs:135:5
105   |
106LL | /     a = b;
107LL | |     b = a;
108   | |_________^ help: try: `std::mem::swap(&mut a, &mut b)`
109   |
110   = note: or maybe you should use `std::mem::replace`?
111   = note: `-D clippy::almost-swapped` implied by `-D warnings`
112   = help: to override `-D warnings` add `#[allow(clippy::almost_swapped)]`
113
114error: this looks like you are trying to swap `c.0` and `a`
115  --> $DIR/swap.rs:144:5
116   |
117LL | /     c.0 = a;
118LL | |     a = c.0;
119   | |___________^ help: try: `std::mem::swap(&mut c.0, &mut a)`
120   |
121   = note: or maybe you should use `std::mem::replace`?
122
123error: this looks like you are trying to swap `a` and `b`
124  --> $DIR/swap.rs:151:5
125   |
126LL | /     let a = b;
127LL | |     let b = a;
128   | |_____________^ help: try: `std::mem::swap(&mut a, &mut b)`
129   |
130   = note: or maybe you should use `std::mem::replace`?
131
132error: this looks like you are trying to swap `d` and `c`
133  --> $DIR/swap.rs:156:5
134   |
135LL | /     d = c;
136LL | |     c = d;
137   | |_________^ help: try: `std::mem::swap(&mut d, &mut c)`
138   |
139   = note: or maybe you should use `std::mem::replace`?
140
141error: this looks like you are trying to swap `a` and `b`
142  --> $DIR/swap.rs:160:5
143   |
144LL | /     let a = b;
145LL | |     b = a;
146   | |_________^ help: try: `std::mem::swap(&mut a, &mut b)`
147   |
148   = note: or maybe you should use `std::mem::replace`?
149
150error: this looks like you are swapping `s.0.x` and `s.0.y` manually
151  --> $DIR/swap.rs:208:5
152   |
153LL | /     let t = s.0.x;
154LL | |     s.0.x = s.0.y;
155LL | |     s.0.y = t;
156   | |______________^ help: try: `std::mem::swap(&mut s.0.x, &mut s.0.y);`
157   |
158   = note: or maybe you should use `std::mem::replace`?
159
160error: aborting due to 17 previous errors
161