]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/indexing_slicing_index.stderr
Merge from rustc
[rust.git] / src / tools / clippy / tests / ui / indexing_slicing_index.stderr
1 error: indexing may panic
2   --> $DIR/indexing_slicing_index.rs:9:20
3    |
4 LL | const REF: &i32 = &ARR[idx()]; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
5    |                    ^^^^^^^^^^
6    |
7    = help: consider using `.get(n)` or `.get_mut(n)` instead
8    = note: the suggestion might not be applicable in constant blocks
9    = note: `-D clippy::indexing-slicing` implied by `-D warnings`
10
11 error: indexing may panic
12   --> $DIR/indexing_slicing_index.rs:10:24
13    |
14 LL | const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
15    |                        ^^^^^^^^^^^
16    |
17    = help: consider using `.get(n)` or `.get_mut(n)` instead
18    = note: the suggestion might not be applicable in constant blocks
19
20 error[E0080]: evaluation of `main::{constant#3}` failed
21   --> $DIR/indexing_slicing_index.rs:31:14
22    |
23 LL |     const { &ARR[idx4()] }; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
24    |              ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
25
26 note: erroneous constant used
27   --> $DIR/indexing_slicing_index.rs:31:5
28    |
29 LL |     const { &ARR[idx4()] }; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
30    |     ^^^^^^^^^^^^^^^^^^^^^^
31
32 error: indexing may panic
33   --> $DIR/indexing_slicing_index.rs:22:5
34    |
35 LL |     x[index];
36    |     ^^^^^^^^
37    |
38    = help: consider using `.get(n)` or `.get_mut(n)` instead
39
40 error: indexing may panic
41   --> $DIR/indexing_slicing_index.rs:30:14
42    |
43 LL |     const { &ARR[idx()] }; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
44    |              ^^^^^^^^^^
45    |
46    = help: consider using `.get(n)` or `.get_mut(n)` instead
47    = note: the suggestion might not be applicable in constant blocks
48
49 error: indexing may panic
50   --> $DIR/indexing_slicing_index.rs:31:14
51    |
52 LL |     const { &ARR[idx4()] }; // This should be linted, since `suppress-restriction-lint-in-const` default is false.
53    |              ^^^^^^^^^^^
54    |
55    = help: consider using `.get(n)` or `.get_mut(n)` instead
56    = note: the suggestion might not be applicable in constant blocks
57
58 error: indexing may panic
59   --> $DIR/indexing_slicing_index.rs:38:5
60    |
61 LL |     v[0];
62    |     ^^^^
63    |
64    = help: consider using `.get(n)` or `.get_mut(n)` instead
65
66 error: indexing may panic
67   --> $DIR/indexing_slicing_index.rs:39:5
68    |
69 LL |     v[10];
70    |     ^^^^^
71    |
72    = help: consider using `.get(n)` or `.get_mut(n)` instead
73
74 error: indexing may panic
75   --> $DIR/indexing_slicing_index.rs:40:5
76    |
77 LL |     v[1 << 3];
78    |     ^^^^^^^^^
79    |
80    = help: consider using `.get(n)` or `.get_mut(n)` instead
81
82 error: indexing may panic
83   --> $DIR/indexing_slicing_index.rs:46:5
84    |
85 LL |     v[N];
86    |     ^^^^
87    |
88    = help: consider using `.get(n)` or `.get_mut(n)` instead
89
90 error: indexing may panic
91   --> $DIR/indexing_slicing_index.rs:47:5
92    |
93 LL |     v[M];
94    |     ^^^^
95    |
96    = help: consider using `.get(n)` or `.get_mut(n)` instead
97
98 error[E0080]: evaluation of constant value failed
99   --> $DIR/indexing_slicing_index.rs:10:24
100    |
101 LL | const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
102    |                        ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
103
104 error: aborting due to 12 previous errors
105
106 For more information about this error, try `rustc --explain E0080`.