]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/indexing_slicing_index.stderr
New upstream version 1.74.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / indexing_slicing_index.stderr
CommitLineData
9c376795 1error: indexing may panic
fe692bf9 2 --> $DIR/indexing_slicing_index.rs:14:20
9c376795
FG
3 |
4LL | 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`
781aab86 10 = help: to override `-D warnings` add `#[allow(clippy::indexing_slicing)]`
9c376795
FG
11
12error: indexing may panic
781aab86 13 --> $DIR/indexing_slicing_index.rs:16:24
9c376795
FG
14 |
15LL | const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
16 | ^^^^^^^^^^^
17 |
18 = help: consider using `.get(n)` or `.get_mut(n)` instead
19 = note: the suggestion might not be applicable in constant blocks
20
04454e1e 21error[E0080]: evaluation of `main::{constant#3}` failed
781aab86 22 --> $DIR/indexing_slicing_index.rs:48:14
04454e1e 23 |
781aab86 24LL | const { &ARR[idx4()] };
04454e1e
FG
25 | ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
26
781aab86
FG
27note: erroneous constant encountered
28 --> $DIR/indexing_slicing_index.rs:48:5
04454e1e 29 |
781aab86 30LL | const { &ARR[idx4()] };
487cf647 31 | ^^^^^^^^^^^^^^^^^^^^^^
04454e1e 32
f20569fa 33error: indexing may panic
781aab86 34 --> $DIR/indexing_slicing_index.rs:29:5
f20569fa
XL
35 |
36LL | x[index];
37 | ^^^^^^^^
38 |
f20569fa 39 = help: consider using `.get(n)` or `.get_mut(n)` instead
9c376795
FG
40
41error: indexing may panic
781aab86 42 --> $DIR/indexing_slicing_index.rs:45:14
9c376795 43 |
781aab86 44LL | const { &ARR[idx()] };
9c376795
FG
45 | ^^^^^^^^^^
46 |
47 = help: consider using `.get(n)` or `.get_mut(n)` instead
48 = note: the suggestion might not be applicable in constant blocks
49
50error: indexing may panic
781aab86 51 --> $DIR/indexing_slicing_index.rs:48:14
9c376795 52 |
781aab86 53LL | const { &ARR[idx4()] };
9c376795
FG
54 | ^^^^^^^^^^^
55 |
56 = help: consider using `.get(n)` or `.get_mut(n)` instead
57 = note: the suggestion might not be applicable in constant blocks
f20569fa
XL
58
59error: indexing may panic
781aab86 60 --> $DIR/indexing_slicing_index.rs:58:5
f20569fa
XL
61 |
62LL | v[0];
63 | ^^^^
64 |
65 = help: consider using `.get(n)` or `.get_mut(n)` instead
66
67error: indexing may panic
781aab86 68 --> $DIR/indexing_slicing_index.rs:60:5
f20569fa
XL
69 |
70LL | v[10];
71 | ^^^^^
72 |
73 = help: consider using `.get(n)` or `.get_mut(n)` instead
74
75error: indexing may panic
781aab86 76 --> $DIR/indexing_slicing_index.rs:62:5
f20569fa
XL
77 |
78LL | v[1 << 3];
79 | ^^^^^^^^^
80 |
81 = help: consider using `.get(n)` or `.get_mut(n)` instead
82
83error: indexing may panic
781aab86 84 --> $DIR/indexing_slicing_index.rs:73:5
f20569fa
XL
85 |
86LL | v[N];
87 | ^^^^
88 |
89 = help: consider using `.get(n)` or `.get_mut(n)` instead
90
91error: indexing may panic
781aab86 92 --> $DIR/indexing_slicing_index.rs:75:5
f20569fa
XL
93 |
94LL | v[M];
95 | ^^^^
96 |
97 = help: consider using `.get(n)` or `.get_mut(n)` instead
98
2b03887a 99error[E0080]: evaluation of constant value failed
781aab86 100 --> $DIR/indexing_slicing_index.rs:16:24
2b03887a
FG
101 |
102LL | const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
103 | ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
104
9c376795 105error: aborting due to 12 previous errors
f20569fa 106
04454e1e 107For more information about this error, try `rustc --explain E0080`.