Merge pull request #4606 from Manishearth/rustup

Fix some tests
This commit is contained in:
Manish Goregaokar 2019-10-01 17:53:14 -07:00 committed by GitHub
commit 648e5b90b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 75 deletions

View file

@ -1,19 +0,0 @@
#![warn(clippy::out_of_bounds_indexing)]
#![allow(clippy::no_effect, clippy::unnecessary_operation)]
fn main() {
let empty: [i8; 0] = [];
empty[0];
&empty[1..5];
&empty[0..=4];
&empty[..=4];
&empty[1..];
&empty[..4];
&empty[0..=0];
&empty[..=0];
&empty[0..]; // Ok, should not produce stderr.
&empty[0..0]; // Ok, should not produce stderr.
&empty[..0]; // Ok, should not produce stderr.
&empty[..]; // Ok, should not produce stderr.
}

View file

@ -1,54 +0,0 @@
error: index out of bounds: the len is 0 but the index is 0
--> $DIR/empty_array.rs:6:5
|
LL | empty[0];
| ^^^^^^^^
|
= note: `#[deny(const_err)]` on by default
error: range is out of bounds
--> $DIR/empty_array.rs:7:12
|
LL | &empty[1..5];
| ^
|
= note: `-D clippy::out-of-bounds-indexing` implied by `-D warnings`
error: range is out of bounds
--> $DIR/empty_array.rs:8:16
|
LL | &empty[0..=4];
| ^
error: range is out of bounds
--> $DIR/empty_array.rs:9:15
|
LL | &empty[..=4];
| ^
error: range is out of bounds
--> $DIR/empty_array.rs:10:12
|
LL | &empty[1..];
| ^
error: range is out of bounds
--> $DIR/empty_array.rs:11:14
|
LL | &empty[..4];
| ^
error: range is out of bounds
--> $DIR/empty_array.rs:12:16
|
LL | &empty[0..=0];
| ^
error: range is out of bounds
--> $DIR/empty_array.rs:13:15
|
LL | &empty[..=0];
| ^
error: aborting due to 8 previous errors

View file

@ -1,5 +1,5 @@
#![warn(clippy::out_of_bounds_indexing)] #![warn(clippy::out_of_bounds_indexing)]
#![allow(clippy::no_effect)] #![allow(clippy::no_effect, const_err)]
fn main() { fn main() {
let x = [1, 2, 3, 4]; let x = [1, 2, 3, 4];

View file

@ -1,5 +1,5 @@
#![warn(clippy::out_of_bounds_indexing)] #![warn(clippy::out_of_bounds_indexing)]
#![allow(clippy::no_effect, clippy::unnecessary_operation)] #![allow(clippy::no_effect, clippy::unnecessary_operation, const_err)]
fn main() { fn main() {
let x = [1, 2, 3, 4]; let x = [1, 2, 3, 4];