Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8002bad

Browse files
committed
Auto merge of rust-lang#5107 - JohnTitor:revive-test, r=flip1995
Revive test in `enum_clike_unportable_variant` Revive one test since mentioned ICE has been resolved. changelog: none
2 parents f69835b + ed6a0cc commit 8002bad

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

tests/ui/enums_clike.rs renamed to tests/ui/enum_clike_unportable_variant.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ignore-x86
22

3-
#![warn(clippy::all)]
4-
#![allow(unused)]
3+
#![warn(clippy::enum_clike_unportable_variant)]
4+
#![allow(unused, non_upper_case_globals)]
55

66
#[repr(usize)]
77
enum NonPortable {
@@ -35,17 +35,16 @@ enum NonPortableSignedNoHint {
3535
A = 0x1_0000_0000,
3636
}
3737

38-
/*
39-
FIXME: uncomment once https://github.com/rust-lang/rust/issues/31910 is fixed
4038
#[repr(usize)]
41-
enum NonPortable2<T: Trait> {
42-
X = Trait::Number,
39+
enum NonPortable2 {
40+
X = <usize as Trait>::Number,
4341
Y = 0,
4442
}
4543

4644
trait Trait {
4745
const Number: usize = 0x1_0000_0000;
4846
}
49-
*/
47+
48+
impl Trait for usize {}
5049

5150
fn main() {}
Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,58 @@
11
error: Clike enum variant discriminant is not portable to 32-bit targets
2-
--> $DIR/enums_clike.rs:8:5
2+
--> $DIR/enum_clike_unportable_variant.rs:8:5
33
|
44
LL | X = 0x1_0000_0000,
55
| ^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::enum-clike-unportable-variant` implied by `-D warnings`
88

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

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

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

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

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

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

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

51-
error: aborting due to 8 previous errors
51+
error: Clike enum variant discriminant is not portable to 32-bit targets
52+
--> $DIR/enum_clike_unportable_variant.rs:40:5
53+
|
54+
LL | X = <usize as Trait>::Number,
55+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
56+
57+
error: aborting due to 9 previous errors
5258

0 commit comments

Comments
 (0)