]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/indexing_slicing_slice.stderr
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / indexing_slicing_slice.stderr
CommitLineData
f20569fa
XL
1error: slicing may panic
2 --> $DIR/indexing_slicing_slice.rs:12:6
3 |
4LL | &x[index..];
5 | ^^^^^^^^^^
6 |
7 = note: `-D clippy::indexing-slicing` implied by `-D warnings`
8 = help: consider using `.get(n..)` or .get_mut(n..)` instead
9
10error: slicing may panic
11 --> $DIR/indexing_slicing_slice.rs:13:6
12 |
13LL | &x[..index];
14 | ^^^^^^^^^^
15 |
16 = help: consider using `.get(..n)`or `.get_mut(..n)` instead
17
18error: slicing may panic
19 --> $DIR/indexing_slicing_slice.rs:14:6
20 |
21LL | &x[index_from..index_to];
22 | ^^^^^^^^^^^^^^^^^^^^^^^
23 |
24 = help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
25
26error: slicing may panic
27 --> $DIR/indexing_slicing_slice.rs:15:6
28 |
29LL | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
30 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
31 |
32 = help: consider using `.get(..n)`or `.get_mut(..n)` instead
33
34error: slicing may panic
35 --> $DIR/indexing_slicing_slice.rs:15:6
36 |
37LL | &x[index_from..][..index_to]; // Two lint reports, one for [index_from..] and another for [..index_to].
38 | ^^^^^^^^^^^^^^^
39 |
40 = help: consider using `.get(n..)` or .get_mut(n..)` instead
41
42error: slicing may panic
43 --> $DIR/indexing_slicing_slice.rs:16:6
44 |
45LL | &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].
46 | ^^^^^^^^^^^^
47 |
48 = help: consider using `.get(..n)`or `.get_mut(..n)` instead
49
50error: range is out of bounds
51 --> $DIR/indexing_slicing_slice.rs:16:8
52 |
53LL | &x[5..][..10]; // Two lint reports, one for out of bounds [5..] and another for slicing [..10].
54 | ^
55 |
56 = note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`
57
58error: slicing may panic
59 --> $DIR/indexing_slicing_slice.rs:17:6
60 |
61LL | &x[0..][..3];
62 | ^^^^^^^^^^^
63 |
64 = help: consider using `.get(..n)`or `.get_mut(..n)` instead
65
66error: slicing may panic
67 --> $DIR/indexing_slicing_slice.rs:18:6
68 |
69LL | &x[1..][..5];
70 | ^^^^^^^^^^^
71 |
72 = help: consider using `.get(..n)`or `.get_mut(..n)` instead
73
74error: range is out of bounds
75 --> $DIR/indexing_slicing_slice.rs:25:12
76 |
77LL | &y[0..=4];
78 | ^
79
80error: range is out of bounds
81 --> $DIR/indexing_slicing_slice.rs:26:11
82 |
83LL | &y[..=4];
84 | ^
85
86error: slicing may panic
87 --> $DIR/indexing_slicing_slice.rs:31:6
88 |
89LL | &v[10..100];
90 | ^^^^^^^^^^
91 |
92 = help: consider using `.get(n..m)` or `.get_mut(n..m)` instead
93
94error: slicing may panic
95 --> $DIR/indexing_slicing_slice.rs:32:6
96 |
97LL | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
98 | ^^^^^^^^^^^^^^
99 |
100 = help: consider using `.get(..n)`or `.get_mut(..n)` instead
101
102error: range is out of bounds
103 --> $DIR/indexing_slicing_slice.rs:32:8
104 |
105LL | &x[10..][..100]; // Two lint reports, one for [10..] and another for [..100].
106 | ^^
107
108error: slicing may panic
109 --> $DIR/indexing_slicing_slice.rs:33:6
110 |
111LL | &v[10..];
112 | ^^^^^^^
113 |
114 = help: consider using `.get(n..)` or .get_mut(n..)` instead
115
116error: slicing may panic
117 --> $DIR/indexing_slicing_slice.rs:34:6
118 |
119LL | &v[..100];
120 | ^^^^^^^^
121 |
122 = help: consider using `.get(..n)`or `.get_mut(..n)` instead
123
124error: aborting due to 16 previous errors
125