Skip to content

Commit

Permalink
Disable effects in libcore again
Browse files Browse the repository at this point in the history
(cherry picked from commit bcdd3d7)
  • Loading branch information
oli-obk authored and cuviper committed Oct 21, 2023
1 parent d598bb6 commit dfe9af5
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 @@ -196,7 +196,6 @@
//
// Language features:
// tidy-alphabetical-start
#![cfg_attr(not(bootstrap), feature(effects))]
#![feature(abi_unadjusted)]
#![feature(adt_const_params)]
#![feature(allow_internal_unsafe)]
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 dfe9af5

Please sign in to comment.