Skip to content

Commit

Permalink
Auto merge of #5107 - JohnTitor:revive-test, r=flip1995
Browse files Browse the repository at this point in the history
Revive test in `enum_clike_unportable_variant`

Revive one test since mentioned ICE has been resolved.

changelog: none
  • Loading branch information
bors committed Jan 30, 2020
2 parents f69835b + ed6a0cc commit 8002bad
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ignore-x86

#![warn(clippy::all)]
#![allow(unused)]
#![warn(clippy::enum_clike_unportable_variant)]
#![allow(unused, non_upper_case_globals)]

#[repr(usize)]
enum NonPortable {
Expand Down Expand Up @@ -35,17 +35,16 @@ enum NonPortableSignedNoHint {
A = 0x1_0000_0000,
}

/*
FIXME: uncomment once https://github.com/rust-lang/rust/issues/31910 is fixed
#[repr(usize)]
enum NonPortable2<T: Trait> {
X = Trait::Number,
enum NonPortable2 {
X = <usize as Trait>::Number,
Y = 0,
}

trait Trait {
const Number: usize = 0x1_0000_0000;
}
*/

impl Trait for usize {}

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,52 +1,58 @@
error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:8:5
--> $DIR/enum_clike_unportable_variant.rs:8:5
|
LL | X = 0x1_0000_0000,
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::enum-clike-unportable-variant` implied by `-D warnings`

error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:15:5
--> $DIR/enum_clike_unportable_variant.rs:15:5
|
LL | X = 0x1_0000_0000,
| ^^^^^^^^^^^^^^^^^

error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:18:5
--> $DIR/enum_clike_unportable_variant.rs:18:5
|
LL | A = 0xFFFF_FFFF,
| ^^^^^^^^^^^^^^^

error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:25:5
--> $DIR/enum_clike_unportable_variant.rs:25:5
|
LL | Z = 0xFFFF_FFFF,
| ^^^^^^^^^^^^^^^

error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:26:5
--> $DIR/enum_clike_unportable_variant.rs:26:5
|
LL | A = 0x1_0000_0000,
| ^^^^^^^^^^^^^^^^^

error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:28:5
--> $DIR/enum_clike_unportable_variant.rs:28:5
|
LL | C = (std::i32::MIN as isize) - 1,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:34:5
--> $DIR/enum_clike_unportable_variant.rs:34:5
|
LL | Z = 0xFFFF_FFFF,
| ^^^^^^^^^^^^^^^

error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enums_clike.rs:35:5
--> $DIR/enum_clike_unportable_variant.rs:35:5
|
LL | A = 0x1_0000_0000,
| ^^^^^^^^^^^^^^^^^

error: aborting due to 8 previous errors
error: Clike enum variant discriminant is not portable to 32-bit targets
--> $DIR/enum_clike_unportable_variant.rs:40:5
|
LL | X = <usize as Trait>::Number,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 9 previous errors

0 comments on commit 8002bad

Please sign in to comment.