mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-31 09:04:18 +00:00
Revive test in enum_clike_unportable_variant
This commit is contained in:
parent
f69835bab7
commit
ed6a0cc8a1
@ -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 {
|
||||
@ -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() {}
|
@ -1,5 +1,5 @@
|
||||
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,
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
@ -7,46 +7,52 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user