about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/manual_swap_auto_fix.stderr
blob: a0bb32233e239f5c9ea36830d2e79837a057ecb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
error: this looks like you are swapping elements of `v` manually
  --> tests/ui/manual_swap_auto_fix.rs:6:5
   |
LL | /     let index = v[0];
LL | |
LL | |
LL | |     v[0] = v[index];
LL | |     v[index] = index;
   | |_____________________^
   |
   = note: `-D clippy::manual-swap` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::manual_swap)]`
help: try
   |
LL ~     let index = v[0];
LL +     v.swap(0, index);
   |

error: this looks like you are swapping elements of `v` manually
  --> tests/ui/manual_swap_auto_fix.rs:15:5
   |
LL | /     let tmp = v[0];
LL | |
LL | |     v[0] = v[1];
LL | |     v[1] = tmp;
   | |_______________^
   |
help: try
   |
LL ~     let tmp = v[0];
LL +     v.swap(0, 1);
   |

error: this looks like you are swapping elements of `v` manually
  --> tests/ui/manual_swap_auto_fix.rs:27:5
   |
LL | /     let temp = v[i1];
LL | |
LL | |     v[i1] = v[i2];
LL | |     v[i2] = temp;
   | |_________________^ help: try: `v.swap(i1, i2);`

error: this looks like you are swapping elements of `v` manually
  --> tests/ui/manual_swap_auto_fix.rs:37:5
   |
LL | /     let temp = v[i1];
LL | |
LL | |     v[i1] = v[i2 + 1];
LL | |     v[i2 + 1] = temp;
   | |_____________________^ help: try: `v.swap(i1, i2 + 1);`

error: this looks like you are swapping elements of `v` manually
  --> tests/ui/manual_swap_auto_fix.rs:47:5
   |
LL | /     let temp = v[i1];
LL | |
LL | |     v[i1] = v[i2 + 1];
LL | |     v[i2 + 1] = temp;
   | |_____________________^ help: try: `v.swap(i1, i2 + 1);`

error: this looks like you are swapping elements of `v` manually
  --> tests/ui/manual_swap_auto_fix.rs:55:5
   |
LL | /     let index = v[0];
LL | |
LL | |
LL | |     v[0] = v[index + 1];
LL | |     v[index + 1] = index;
   | |_________________________^
   |
help: try
   |
LL ~     let index = v[0];
LL +     v.swap(0, index + 1);
   |

error: this looks like you are swapping elements of `v` manually
  --> tests/ui/manual_swap_auto_fix.rs:66:5
   |
LL | /     let tmp = v[i1 * 3];
LL | |
LL | |     v[i1 * 3] = v[i2 / 2];
LL | |     v[i2 / 2] = tmp;
   | |____________________^ help: try: `v.swap(i1 * 3, i2 / 2);`

error: this looks like you are swapping elements of `v` manually
  --> tests/ui/manual_swap_auto_fix.rs:76:5
   |
LL | /     let tmp = v[i1 + i2];
LL | |
LL | |     v[i1 + i2] = v[i2];
LL | |     v[i2] = tmp;
   | |________________^ help: try: `v.swap(i1 + i2, i2);`

error: this looks like you are swapping elements of `v` manually
  --> tests/ui/manual_swap_auto_fix.rs:87:9
   |
LL | /         let tmp = v[i1];
LL | |
LL | |         v[i1] = v[i2];
LL | |         v[i2] = tmp;
   | |____________________^ help: try: `v.swap(i1, i2);`

error: aborting due to 9 previous errors