From e0b61111f83d4465fcc439d4186710f860b05a4b Mon Sep 17 00:00:00 2001 From: varkor Date: Sat, 3 Oct 2020 14:47:28 +0100 Subject: [PATCH 1/2] Mark `repr128` as `incomplete_features` --- compiler/rustc_feature/src/active.rs | 1 + src/test/ui/enum-discriminant/discriminant_size.rs | 1 + .../ui/enum-discriminant/discriminant_size.stderr | 11 +++++++++++ .../ui/enum-discriminant/issue-70509-partial_eq.rs | 1 + .../enum-discriminant/issue-70509-partial_eq.stderr | 11 +++++++++++ src/test/ui/enum-discriminant/repr128.rs | 1 + src/test/ui/enum-discriminant/repr128.stderr | 11 +++++++++++ src/test/ui/issues/issue-43398.rs | 1 + src/test/ui/issues/issue-43398.stderr | 11 +++++++++++ 9 files changed, 49 insertions(+) create mode 100644 src/test/ui/enum-discriminant/discriminant_size.stderr create mode 100644 src/test/ui/enum-discriminant/issue-70509-partial_eq.stderr create mode 100644 src/test/ui/enum-discriminant/repr128.stderr create mode 100644 src/test/ui/issues/issue-43398.stderr diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index c13fe2ae2806b..04912fe409679 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -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 diff --git a/src/test/ui/enum-discriminant/discriminant_size.rs b/src/test/ui/enum-discriminant/discriminant_size.rs index 4cede8c2a2ded..b939a70dfc568 100644 --- a/src/test/ui/enum-discriminant/discriminant_size.rs +++ b/src/test/ui/enum-discriminant/discriminant_size.rs @@ -1,5 +1,6 @@ // run-pass #![feature(core_intrinsics, repr128)] +//~^ WARN the feature `repr128` is incomplete use std::intrinsics::discriminant_value; diff --git a/src/test/ui/enum-discriminant/discriminant_size.stderr b/src/test/ui/enum-discriminant/discriminant_size.stderr new file mode 100644 index 0000000000000..efc7d998466cd --- /dev/null +++ b/src/test/ui/enum-discriminant/discriminant_size.stderr @@ -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 for more information + +warning: 1 warning emitted + diff --git a/src/test/ui/enum-discriminant/issue-70509-partial_eq.rs b/src/test/ui/enum-discriminant/issue-70509-partial_eq.rs index 4e2cc89948a01..ae389e1146645 100644 --- a/src/test/ui/enum-discriminant/issue-70509-partial_eq.rs +++ b/src/test/ui/enum-discriminant/issue-70509-partial_eq.rs @@ -1,5 +1,6 @@ // run-pass #![feature(repr128, arbitrary_enum_discriminant)] +//~^ WARN the feature `repr128` is incomplete #[derive(PartialEq, Debug)] #[repr(i128)] diff --git a/src/test/ui/enum-discriminant/issue-70509-partial_eq.stderr b/src/test/ui/enum-discriminant/issue-70509-partial_eq.stderr new file mode 100644 index 0000000000000..5bf6ea56ebc77 --- /dev/null +++ b/src/test/ui/enum-discriminant/issue-70509-partial_eq.stderr @@ -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 for more information + +warning: 1 warning emitted + diff --git a/src/test/ui/enum-discriminant/repr128.rs b/src/test/ui/enum-discriminant/repr128.rs index eefbc44f585b2..00021a07b3719 100644 --- a/src/test/ui/enum-discriminant/repr128.rs +++ b/src/test/ui/enum-discriminant/repr128.rs @@ -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; diff --git a/src/test/ui/enum-discriminant/repr128.stderr b/src/test/ui/enum-discriminant/repr128.stderr new file mode 100644 index 0000000000000..88adfb1742d5d --- /dev/null +++ b/src/test/ui/enum-discriminant/repr128.stderr @@ -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 for more information + +warning: 1 warning emitted + diff --git a/src/test/ui/issues/issue-43398.rs b/src/test/ui/issues/issue-43398.rs index f0b762c6254a3..581db033f9257 100644 --- a/src/test/ui/issues/issue-43398.rs +++ b/src/test/ui/issues/issue-43398.rs @@ -2,6 +2,7 @@ #![feature(core_intrinsics)] #![feature(repr128)] +//~^ WARN the feature `repr128` is incomplete #[repr(i128)] enum Big { A, B } diff --git a/src/test/ui/issues/issue-43398.stderr b/src/test/ui/issues/issue-43398.stderr new file mode 100644 index 0000000000000..9a394153bf62f --- /dev/null +++ b/src/test/ui/issues/issue-43398.stderr @@ -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 for more information + +warning: 1 warning emitted + From 683db310c4a2e205bd954ea030cff3ce2fa9ef68 Mon Sep 17 00:00:00 2001 From: varkor Date: Thu, 22 Oct 2020 13:23:14 +0100 Subject: [PATCH 2/2] Fix clippy tests --- src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs | 1 + src/tools/clippy/tests/ui/auxiliary/proc_macro_derive.rs | 1 + src/tools/clippy/tests/ui/crashes/auxiliary/proc_macro_crash.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs b/src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs index de670cdfc31f1..e370a98df1acf 100644 --- a/src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs +++ b/src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs @@ -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; diff --git a/src/tools/clippy/tests/ui/auxiliary/proc_macro_derive.rs b/src/tools/clippy/tests/ui/auxiliary/proc_macro_derive.rs index 3df8be6c23230..cd5a5ae0aa75a 100644 --- a/src/tools/clippy/tests/ui/auxiliary/proc_macro_derive.rs +++ b/src/tools/clippy/tests/ui/auxiliary/proc_macro_derive.rs @@ -3,6 +3,7 @@ #![crate_type = "proc-macro"] #![feature(repr128, proc_macro_quote)] +#![allow(incomplete_features)] extern crate proc_macro; diff --git a/src/tools/clippy/tests/ui/crashes/auxiliary/proc_macro_crash.rs b/src/tools/clippy/tests/ui/crashes/auxiliary/proc_macro_crash.rs index 619d11cefc46d..ed8e7a708a5e2 100644 --- a/src/tools/clippy/tests/ui/crashes/auxiliary/proc_macro_crash.rs +++ b/src/tools/clippy/tests/ui/crashes/auxiliary/proc_macro_crash.rs @@ -6,6 +6,7 @@ // contain a proc-macro. #![feature(repr128)] +#![allow(incomplete_features)] #![crate_type = "proc-macro"] extern crate proc_macro;