Skip to content

Commit

Permalink
Rollup merge of rust-lang#77488 - varkor:repr128-incomplete_features,…
Browse files Browse the repository at this point in the history
… r=jonas-schievink

Mark `repr128` as `incomplete_features`

As mentioned in rust-lang#56071 and noticed in rust-lang#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 rust-lang#77457.
  • Loading branch information
Dylan-DPC committed Oct 22, 2020
2 parents ff817fa + 683db31 commit 84b134c
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ pub const INCOMPLETE_FEATURES: &[Symbol] = &[
sym::lazy_normalization_consts,
sym::specialization,
sym::inline_const,
sym::repr128,
];

/// Some features are not allowed to be used together at the same time, if
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/enum-discriminant/discriminant_size.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
#![feature(core_intrinsics, repr128)]
//~^ WARN the feature `repr128` is incomplete

use std::intrinsics::discriminant_value;

Expand Down
11 changes: 11 additions & 0 deletions src/test/ui/enum-discriminant/discriminant_size.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: the feature `repr128` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/discriminant_size.rs:2:29
|
LL | #![feature(core_intrinsics, repr128)]
| ^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information

warning: 1 warning emitted

1 change: 1 addition & 0 deletions src/test/ui/enum-discriminant/issue-70509-partial_eq.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
#![feature(repr128, arbitrary_enum_discriminant)]
//~^ WARN the feature `repr128` is incomplete

#[derive(PartialEq, Debug)]
#[repr(i128)]
Expand Down
11 changes: 11 additions & 0 deletions src/test/ui/enum-discriminant/issue-70509-partial_eq.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: the feature `repr128` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-70509-partial_eq.rs:2:12
|
LL | #![feature(repr128, arbitrary_enum_discriminant)]
| ^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information

warning: 1 warning emitted

1 change: 1 addition & 0 deletions src/test/ui/enum-discriminant/repr128.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
#![feature(repr128, core_intrinsics, discriminant_kind)]
//~^ WARN the feature `repr128` is incomplete

use std::intrinsics::discriminant_value;
use std::marker::DiscriminantKind;
Expand Down
11 changes: 11 additions & 0 deletions src/test/ui/enum-discriminant/repr128.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: the feature `repr128` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/repr128.rs:2:12
|
LL | #![feature(repr128, core_intrinsics, discriminant_kind)]
| ^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information

warning: 1 warning emitted

1 change: 1 addition & 0 deletions src/test/ui/issues/issue-43398.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#![feature(core_intrinsics)]
#![feature(repr128)]
//~^ WARN the feature `repr128` is incomplete

#[repr(i128)]
enum Big { A, B }
Expand Down
11 changes: 11 additions & 0 deletions src/test/ui/issues/issue-43398.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: the feature `repr128` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-43398.rs:4:12
|
LL | #![feature(repr128)]
| ^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information

warning: 1 warning emitted

1 change: 1 addition & 0 deletions src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#![crate_type = "proc-macro"]
#![feature(repr128, proc_macro_hygiene, proc_macro_quote, box_patterns)]
#![allow(incomplete_features)]
#![allow(clippy::useless_conversion)]

extern crate proc_macro;
Expand Down
1 change: 1 addition & 0 deletions src/tools/clippy/tests/ui/auxiliary/proc_macro_derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#![crate_type = "proc-macro"]
#![feature(repr128, proc_macro_quote)]
#![allow(incomplete_features)]

extern crate proc_macro;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// contain a proc-macro.

#![feature(repr128)]
#![allow(incomplete_features)]
#![crate_type = "proc-macro"]

extern crate proc_macro;
Expand Down

0 comments on commit 84b134c

Please sign in to comment.