]> git.lizzy.rs Git - rust.git/blob - tests/ui/indexing_slicing_index.stderr
rustup https://github.com/rust-lang/rust/pull/69325, update test stderr
[rust.git] / tests / ui / indexing_slicing_index.stderr
1 error: this operation will panic at runtime
2   --> $DIR/indexing_slicing_index.rs:11:5
3    |
4 LL |     x[4]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
5    |     ^^^^ index out of bounds: the len is 4 but the index is 4
6    |
7    = note: `#[deny(unconditional_panic)]` on by default
8
9 error: this operation will panic at runtime
10   --> $DIR/indexing_slicing_index.rs:12:5
11    |
12 LL |     x[1 << 3]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
13    |     ^^^^^^^^^ index out of bounds: the len is 4 but the index is 8
14
15 error: this operation will panic at runtime
16   --> $DIR/indexing_slicing_index.rs:27:5
17    |
18 LL |     x[N]; // Ok, let rustc's `const_err` lint handle `usize` indexing on arrays.
19    |     ^^^^ index out of bounds: the len is 4 but the index is 15
20
21 error: indexing may panic.
22   --> $DIR/indexing_slicing_index.rs:10:5
23    |
24 LL |     x[index];
25    |     ^^^^^^^^
26    |
27    = note: `-D clippy::indexing-slicing` implied by `-D warnings`
28    = help: Consider using `.get(n)` or `.get_mut(n)` instead
29
30 error: indexing may panic.
31   --> $DIR/indexing_slicing_index.rs:18:5
32    |
33 LL |     y[0];
34    |     ^^^^
35    |
36    = help: Consider using `.get(n)` or `.get_mut(n)` instead
37
38 error: indexing may panic.
39   --> $DIR/indexing_slicing_index.rs:21:5
40    |
41 LL |     v[0];
42    |     ^^^^
43    |
44    = help: Consider using `.get(n)` or `.get_mut(n)` instead
45
46 error: indexing may panic.
47   --> $DIR/indexing_slicing_index.rs:22:5
48    |
49 LL |     v[10];
50    |     ^^^^^
51    |
52    = help: Consider using `.get(n)` or `.get_mut(n)` instead
53
54 error: indexing may panic.
55   --> $DIR/indexing_slicing_index.rs:23:5
56    |
57 LL |     v[1 << 3];
58    |     ^^^^^^^^^
59    |
60    = help: Consider using `.get(n)` or `.get_mut(n)` instead
61
62 error: indexing may panic.
63   --> $DIR/indexing_slicing_index.rs:29:5
64    |
65 LL |     v[N];
66    |     ^^^^
67    |
68    = help: Consider using `.get(n)` or `.get_mut(n)` instead
69
70 error: indexing may panic.
71   --> $DIR/indexing_slicing_index.rs:30:5
72    |
73 LL |     v[M];
74    |     ^^^^
75    |
76    = help: Consider using `.get(n)` or `.get_mut(n)` instead
77
78 error: aborting due to 10 previous errors
79