Skip to content

Commit da3e41e

Browse files
authored
Rollup merge of #77488 - varkor:repr128-incomplete_features, r=jonas-schievink
Mark `repr128` as `incomplete_features` As mentioned in #56071 and noticed in #77457, `repr(u128)` and `repr(i128)` do not work properly due to lack of LLVM support. We should thus warn users trying to use the feature that they may encounter ICEs when using it. Closes #77457.
2 parents 8e37330 + 683db31 commit da3e41e

File tree

12 files changed

+52
-0
lines changed

12 files changed

+52
-0
lines changed

Diff for: compiler/rustc_feature/src/active.rs

+1
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ pub const INCOMPLETE_FEATURES: &[Symbol] = &[
622622
sym::lazy_normalization_consts,
623623
sym::specialization,
624624
sym::inline_const,
625+
sym::repr128,
625626
];
626627

627628
/// Some features are not allowed to be used together at the same time, if

Diff for: src/test/ui/enum-discriminant/discriminant_size.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-pass
22
#![feature(core_intrinsics, repr128)]
3+
//~^ WARN the feature `repr128` is incomplete
34

45
use std::intrinsics::discriminant_value;
56

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
warning: the feature `repr128` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/discriminant_size.rs:2:29
3+
|
4+
LL | #![feature(core_intrinsics, repr128)]
5+
| ^^^^^^^
6+
|
7+
= note: `#[warn(incomplete_features)]` on by default
8+
= note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information
9+
10+
warning: 1 warning emitted
11+

Diff for: src/test/ui/enum-discriminant/issue-70509-partial_eq.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-pass
22
#![feature(repr128, arbitrary_enum_discriminant)]
3+
//~^ WARN the feature `repr128` is incomplete
34

45
#[derive(PartialEq, Debug)]
56
#[repr(i128)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
warning: the feature `repr128` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/issue-70509-partial_eq.rs:2:12
3+
|
4+
LL | #![feature(repr128, arbitrary_enum_discriminant)]
5+
| ^^^^^^^
6+
|
7+
= note: `#[warn(incomplete_features)]` on by default
8+
= note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information
9+
10+
warning: 1 warning emitted
11+

Diff for: src/test/ui/enum-discriminant/repr128.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-pass
22
#![feature(repr128, core_intrinsics, discriminant_kind)]
3+
//~^ WARN the feature `repr128` is incomplete
34

45
use std::intrinsics::discriminant_value;
56
use std::marker::DiscriminantKind;

Diff for: src/test/ui/enum-discriminant/repr128.stderr

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
warning: the feature `repr128` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/repr128.rs:2:12
3+
|
4+
LL | #![feature(repr128, core_intrinsics, discriminant_kind)]
5+
| ^^^^^^^
6+
|
7+
= note: `#[warn(incomplete_features)]` on by default
8+
= note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information
9+
10+
warning: 1 warning emitted
11+

Diff for: src/test/ui/issues/issue-43398.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#![feature(core_intrinsics)]
44
#![feature(repr128)]
5+
//~^ WARN the feature `repr128` is incomplete
56

67
#[repr(i128)]
78
enum Big { A, B }

Diff for: src/test/ui/issues/issue-43398.stderr

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
warning: the feature `repr128` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/issue-43398.rs:4:12
3+
|
4+
LL | #![feature(repr128)]
5+
| ^^^^^^^
6+
|
7+
= note: `#[warn(incomplete_features)]` on by default
8+
= note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information
9+
10+
warning: 1 warning emitted
11+

Diff for: src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#![crate_type = "proc-macro"]
55
#![feature(repr128, proc_macro_hygiene, proc_macro_quote, box_patterns)]
6+
#![allow(incomplete_features)]
67
#![allow(clippy::useless_conversion)]
78

89
extern crate proc_macro;

Diff for: src/tools/clippy/tests/ui/auxiliary/proc_macro_derive.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#![crate_type = "proc-macro"]
55
#![feature(repr128, proc_macro_quote)]
6+
#![allow(incomplete_features)]
67

78
extern crate proc_macro;
89

Diff for: src/tools/clippy/tests/ui/crashes/auxiliary/proc_macro_crash.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// contain a proc-macro.
77

88
#![feature(repr128)]
9+
#![allow(incomplete_features)]
910
#![crate_type = "proc-macro"]
1011

1112
extern crate proc_macro;

0 commit comments

Comments
 (0)