Skip to content

Commit a536d58

Browse files
authored
Rollup merge of rust-lang#116856 - oli-obk:no_effects, r=compiler-errors
Disable effects in libcore again r? `@fee1-dead` This was accidentally allowed by rust-lang#114776 without feature gates
2 parents 0653d7e + bcdd3d7 commit a536d58

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

library/core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@
219219
#![feature(doc_cfg)]
220220
#![feature(doc_cfg_hide)]
221221
#![feature(doc_notable_trait)]
222-
#![feature(effects)]
223222
#![feature(exhaustive_patterns)]
224223
#![feature(extern_types)]
225224
#![feature(fundamental)]

tests/ui/consts/effect_param.rs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//! Ensure we don't allow accessing const effect parameters from stable Rust.
2+
3+
fn main() {
4+
i8::checked_sub::<true>(42, 43);
5+
//~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied
6+
}
7+
8+
const FOO: () = {
9+
i8::checked_sub::<false>(42, 43);
10+
//~^ ERROR: method takes 0 generic arguments but 1 generic argument was supplied
11+
};

tests/ui/consts/effect_param.stderr

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied
2+
--> $DIR/effect_param.rs:9:9
3+
|
4+
LL | i8::checked_sub::<false>(42, 43);
5+
| ^^^^^^^^^^^--------- help: remove these generics
6+
| |
7+
| expected 0 generic arguments
8+
9+
error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied
10+
--> $DIR/effect_param.rs:4:9
11+
|
12+
LL | i8::checked_sub::<true>(42, 43);
13+
| ^^^^^^^^^^^-------- help: remove these generics
14+
| |
15+
| expected 0 generic arguments
16+
17+
error: aborting due to 2 previous errors
18+
19+
For more information about this error, try `rustc --explain E0107`.

0 commit comments

Comments
 (0)