Skip to content

Commit

Permalink
Disable effects in libcore again
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Oct 17, 2023
1 parent 93e62a2 commit bcdd3d7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
1 change: 0 additions & 1 deletion library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
11 changes: 11 additions & 0 deletions tests/ui/consts/effect_param.rs
Original file line number Diff line number Diff line change
@@ -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
};
19 changes: 19 additions & 0 deletions tests/ui/consts/effect_param.stderr
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit bcdd3d7

Please sign in to comment.