From bcdd3d77397295f1e20cd257c306d25c3a32dde2 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Tue, 17 Oct 2023 17:52:11 +0000 Subject: [PATCH] Disable effects in libcore again --- library/core/src/lib.rs | 1 - tests/ui/consts/effect_param.rs | 11 +++++++++++ tests/ui/consts/effect_param.stderr | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tests/ui/consts/effect_param.rs create mode 100644 tests/ui/consts/effect_param.stderr diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 963545a2eb2de..03243e31348e9 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -219,7 +219,6 @@ #![feature(doc_cfg)] #![feature(doc_cfg_hide)] #![feature(doc_notable_trait)] -#![feature(effects)] #![feature(exhaustive_patterns)] #![feature(extern_types)] #![feature(fundamental)] diff --git a/tests/ui/consts/effect_param.rs b/tests/ui/consts/effect_param.rs new file mode 100644 index 0000000000000..f11ec739fce53 --- /dev/null +++ b/tests/ui/consts/effect_param.rs @@ -0,0 +1,11 @@ +//! Ensure we don't allow accessing const effect parameters from stable Rust. + +fn main() { + i8::checked_sub::(42, 43); + //~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied +} + +const FOO: () = { + i8::checked_sub::(42, 43); + //~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied +}; diff --git a/tests/ui/consts/effect_param.stderr b/tests/ui/consts/effect_param.stderr new file mode 100644 index 0000000000000..f8c4bfc02e541 --- /dev/null +++ b/tests/ui/consts/effect_param.stderr @@ -0,0 +1,19 @@ +error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied + --> $DIR/effect_param.rs:9:9 + | +LL | i8::checked_sub::(42, 43); + | ^^^^^^^^^^^--------- help: remove these generics + | | + | expected 0 generic arguments + +error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied + --> $DIR/effect_param.rs:4:9 + | +LL | i8::checked_sub::(42, 43); + | ^^^^^^^^^^^-------- help: remove these generics + | | + | expected 0 generic arguments + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0107`.