Disable effects in libcore again

This commit is contained in:
Oli Scherer 2023-10-17 17:52:11 +00:00
parent 93e62a260f
commit bcdd3d7739
3 changed files with 30 additions and 1 deletions

View File

@ -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)]

View File

@ -0,0 +1,11 @@
//! Ensure we don't allow accessing const effect parameters from stable Rust.
fn main() {
i8::checked_sub::<true>(42, 43);
//~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied
}
const FOO: () = {
i8::checked_sub::<false>(42, 43);
//~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied
};

View File

@ -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::<false>(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::<true>(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`.