Skip to content

Rollup of 5 pull requests #116885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Oct 18, 2023
Merged
Prev Previous commit
Next Next commit
Disable effects in libcore again
  • Loading branch information
oli-obk committed Oct 17, 2023
commit bcdd3d77397295f1e20cd257c306d25c3a32dde2
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`.