Skip to content

Commit 505d833

Browse files
Yeet effects feature
1 parent a31978c commit 505d833

File tree

176 files changed

+278
-751
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+278
-751
lines changed

compiler/rustc_feature/src/removed.rs

+3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ declare_features! (
100100
Some("renamed to `doc_notable_trait`")),
101101
/// Allows using `#[unsafe_destructor_blind_to_params]` (RFC 1238).
102102
(removed, dropck_parametricity, "1.38.0", Some(28498), None),
103+
/// Uses generic effect parameters for ~const bounds
104+
(removed, effects, "CURRENT_RUSTC_VERSION", Some(102090),
105+
Some("removed, redundant with `#![feature(const_trait_impl)]`")),
103106
/// Allows defining `existential type`s.
104107
(removed, existential_type, "1.38.0", Some(63063),
105108
Some("removed in favor of `#![feature(type_alias_impl_trait)]`")),

compiler/rustc_feature/src/unstable.rs

-2
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,6 @@ declare_features! (
462462
(unstable, doc_masked, "1.21.0", Some(44027)),
463463
/// Allows `dyn* Trait` objects.
464464
(incomplete, dyn_star, "1.65.0", Some(102425)),
465-
/// Uses generic effect parameters for ~const bounds
466-
(incomplete, effects, "1.72.0", Some(102090)),
467465
/// Allows exhaustive pattern matching on types that contain uninhabited types.
468466
(unstable, exhaustive_patterns, "1.13.0", Some(51085)),
469467
/// Allows explicit tail calls via `become` expression.

tests/crashes/112623.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ known-bug: #112623
22

3-
#![feature(const_trait_impl, effects)]
3+
#![feature(const_trait_impl)]
44

55
#[const_trait]
66
trait Value {

tests/crashes/119701.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ known-bug: #119701
2-
#![feature(const_trait_impl, effects, generic_const_exprs)]
2+
#![feature(const_trait_impl, generic_const_exprs)]
33

44
fn main() {
55
let _ = process::<()>([()]);

tests/crashes/121411.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ known-bug: #121411
2-
#![feature(const_trait_impl, effects)]
2+
#![feature(const_trait_impl)]
33

44
#[const_trait]
55
trait Foo {

tests/rustdoc/const-effect-param.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Check that we don't render host effect parameters & arguments.
22

33
#![crate_name = "foo"]
4-
#![feature(effects, const_trait_impl)]
4+
#![feature(const_trait_impl)]
55
#![allow(incomplete_features)]
66

77
#[const_trait]

tests/rustdoc/const-fn-effects.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#![crate_name = "foo"]
2-
#![feature(effects)]
3-
#![allow(incomplete_features)]
42

53
//@ has foo/fn.bar.html
64
//@ has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> '

tests/rustdoc/inline_cross/auxiliary/const-effect-param.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ compile-flags: -Znext-solver
2-
#![feature(effects, const_trait_impl)]
3-
#![allow(incomplete_features)]
2+
#![feature(const_trait_impl)]
43

54
#[const_trait]
65
pub trait Resource {}

tests/rustdoc/rfc-2632-const-trait-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// FIXME(effects) add `const_trait` to `Fn` so we use `~const`
1010
// FIXME(effects) restore `const_trait` to `Destruct`
1111
#![allow(incomplete_features)]
12-
#![feature(const_trait_impl, effects)]
12+
#![feature(const_trait_impl)]
1313
#![crate_name = "foo"]
1414

1515
use std::marker::Destruct;

tests/ui/const-generics/const_trait_fn-issue-88433.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
//@ build-pass
22
//@ compile-flags: -Znext-solver
33

4-
#![allow(incomplete_features)]
5-
#![feature(const_trait_impl, effects)]
4+
#![feature(const_trait_impl)]
65

76
#[const_trait]
87
trait Func<T> {

tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ known-bug: #110395
22
//@ compile-flags: -Znext-solver
3-
#![feature(generic_const_exprs, adt_const_params, const_trait_impl, effects)]
3+
#![feature(generic_const_exprs, adt_const_params, const_trait_impl)]
44
#![allow(incomplete_features)]
55

66
// test `N + N` unifies with explicit function calls for non-builtin-types

tests/ui/const-generics/generic_const_exprs/unify-op-with-fn-call.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: `-Znext-solver=globally` and `generic_const_exprs` are incompatible, using them at the same time is not allowed
22
--> $DIR/unify-op-with-fn-call.rs:3:12
33
|
4-
LL | #![feature(generic_const_exprs, adt_const_params, const_trait_impl, effects)]
4+
LL | #![feature(generic_const_exprs, adt_const_params, const_trait_impl)]
55
| ^^^^^^^^^^^^^^^^^^^
66
|
77
= help: remove one of these features

tests/ui/const-generics/issues/issue-88119.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ known-bug: #110395
22
//@ compile-flags: -Znext-solver
33
#![allow(incomplete_features)]
4-
#![feature(const_trait_impl, effects, generic_const_exprs)]
4+
#![feature(const_trait_impl, generic_const_exprs)]
55

66
#[const_trait]
77
trait ConstName {

tests/ui/const-generics/issues/issue-88119.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: `-Znext-solver=globally` and `generic_const_exprs` are incompatible, using them at the same time is not allowed
2-
--> $DIR/issue-88119.rs:4:39
2+
--> $DIR/issue-88119.rs:4:30
33
|
4-
LL | #![feature(const_trait_impl, effects, generic_const_exprs)]
5-
| ^^^^^^^^^^^^^^^^^^^
4+
LL | #![feature(const_trait_impl, generic_const_exprs)]
5+
| ^^^^^^^^^^^^^^^^^^^
66
|
77
= help: remove one of these features
88

tests/ui/consts/auxiliary/closure-in-foreign-crate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ compile-flags: -Znext-solver
22
#![crate_type = "lib"]
3-
#![feature(const_closures, const_trait_impl, effects)]
3+
#![feature(const_closures, const_trait_impl)]
44
#![allow(incomplete_features)]
55

66
pub const fn test() {

tests/ui/consts/const-try.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#![crate_type = "lib"]
66
#![feature(try_trait_v2)]
7-
#![feature(const_trait_impl, effects)]
7+
#![feature(const_trait_impl)]
88
#![feature(const_try)]
99
#![allow(incomplete_features)]
1010

tests/ui/consts/const_cmp_type_id.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ compile-flags: -Znext-solver
2-
#![feature(const_type_id, const_trait_impl, effects)]
2+
#![feature(const_type_id, const_trait_impl)]
33
#![allow(incomplete_features)]
44

55
use std::any::TypeId;

tests/ui/consts/constifconst-call-in-const-position.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ known-bug: #102498
22

3-
#![feature(const_trait_impl, effects, generic_const_exprs)]
3+
#![feature(const_trait_impl, generic_const_exprs)]
44
#![allow(incomplete_features)]
55

66
#[const_trait]

tests/ui/consts/rustc-impl-const-stability.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@ known-bug: #110395
33

44
#![crate_type = "lib"]
5-
#![feature(staged_api, const_trait_impl, effects)]
5+
#![feature(staged_api, const_trait_impl)]
66
#![allow(incomplete_features)]
77
#![stable(feature = "foo", since = "1.0.0")]
88

tests/ui/delegation/unsupported.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(const_trait_impl)]
22
#![feature(c_variadic)]
3-
#![feature(effects)]
43
#![feature(fn_delegation)]
54
#![allow(incomplete_features)]
65

tests/ui/delegation/unsupported.stderr

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:26:5: 26:24>::{synthetic#0}`
2-
--> $DIR/unsupported.rs:27:25
1+
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:25:5: 25:24>::{synthetic#0}`
2+
--> $DIR/unsupported.rs:26:25
33
|
44
LL | reuse to_reuse::opaque_ret;
55
| ^^^^^^^^^^
66
|
77
note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process...
8-
--> $DIR/unsupported.rs:27:25
8+
--> $DIR/unsupported.rs:26:25
99
|
1010
LL | reuse to_reuse::opaque_ret;
1111
| ^^^^^^^^^^
12-
= note: ...which again requires computing type of `opaque::<impl at $DIR/unsupported.rs:26:5: 26:24>::{synthetic#0}`, completing the cycle
13-
note: cycle used when checking that `opaque::<impl at $DIR/unsupported.rs:26:5: 26:24>` is well-formed
14-
--> $DIR/unsupported.rs:26:5
12+
= note: ...which again requires computing type of `opaque::<impl at $DIR/unsupported.rs:25:5: 25:24>::{synthetic#0}`, completing the cycle
13+
note: cycle used when checking that `opaque::<impl at $DIR/unsupported.rs:25:5: 25:24>` is well-formed
14+
--> $DIR/unsupported.rs:25:5
1515
|
1616
LL | impl ToReuse for u8 {
1717
| ^^^^^^^^^^^^^^^^^^^
1818
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
1919

2020
warning: this function depends on never type fallback being `()`
21-
--> $DIR/unsupported.rs:14:9
21+
--> $DIR/unsupported.rs:13:9
2222
|
2323
LL | pub fn opaque_ret() -> impl Trait { unimplemented!() }
2424
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -27,14 +27,14 @@ LL | pub fn opaque_ret() -> impl Trait { unimplemented!() }
2727
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
2828
= help: specify the types explicitly
2929
note: in edition 2024, the requirement `!: opaque::Trait` will fail
30-
--> $DIR/unsupported.rs:14:32
30+
--> $DIR/unsupported.rs:13:32
3131
|
3232
LL | pub fn opaque_ret() -> impl Trait { unimplemented!() }
3333
| ^^^^^^^^^^
3434
= note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
3535

3636
warning: this function depends on never type fallback being `()`
37-
--> $DIR/unsupported.rs:20:9
37+
--> $DIR/unsupported.rs:19:9
3838
|
3939
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
4040
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -43,32 +43,32 @@ LL | fn opaque_ret() -> impl Trait { unimplemented!() }
4343
= note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
4444
= help: specify the types explicitly
4545
note: in edition 2024, the requirement `!: opaque::Trait` will fail
46-
--> $DIR/unsupported.rs:20:28
46+
--> $DIR/unsupported.rs:19:28
4747
|
4848
LL | fn opaque_ret() -> impl Trait { unimplemented!() }
4949
| ^^^^^^^^^^
5050

51-
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:29:5: 29:25>::{synthetic#0}`
52-
--> $DIR/unsupported.rs:30:24
51+
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:28:5: 28:25>::{synthetic#0}`
52+
--> $DIR/unsupported.rs:29:24
5353
|
5454
LL | reuse ToReuse::opaque_ret;
5555
| ^^^^^^^^^^
5656
|
5757
note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process...
58-
--> $DIR/unsupported.rs:30:24
58+
--> $DIR/unsupported.rs:29:24
5959
|
6060
LL | reuse ToReuse::opaque_ret;
6161
| ^^^^^^^^^^
62-
= note: ...which again requires computing type of `opaque::<impl at $DIR/unsupported.rs:29:5: 29:25>::{synthetic#0}`, completing the cycle
63-
note: cycle used when checking that `opaque::<impl at $DIR/unsupported.rs:29:5: 29:25>` is well-formed
64-
--> $DIR/unsupported.rs:29:5
62+
= note: ...which again requires computing type of `opaque::<impl at $DIR/unsupported.rs:28:5: 28:25>::{synthetic#0}`, completing the cycle
63+
note: cycle used when checking that `opaque::<impl at $DIR/unsupported.rs:28:5: 28:25>` is well-formed
64+
--> $DIR/unsupported.rs:28:5
6565
|
6666
LL | impl ToReuse for u16 {
6767
| ^^^^^^^^^^^^^^^^^^^^
6868
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
6969

7070
error: recursive delegation is not supported yet
71-
--> $DIR/unsupported.rs:43:22
71+
--> $DIR/unsupported.rs:42:22
7272
|
7373
LL | pub reuse to_reuse2::foo;
7474
| --- callee defined here
@@ -77,7 +77,7 @@ LL | reuse to_reuse1::foo;
7777
| ^^^
7878

7979
error[E0283]: type annotations needed
80-
--> $DIR/unsupported.rs:53:18
80+
--> $DIR/unsupported.rs:52:18
8181
|
8282
LL | reuse Trait::foo;
8383
| ^^^ cannot infer type

tests/ui/dropck/const_drop_is_valid.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#![feature(effects)]
2-
//~^ WARN: the feature `effects` is incomplete
3-
41
struct A();
52

63
impl const Drop for A {}
+4-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: const trait impls are experimental
2-
--> $DIR/const_drop_is_valid.rs:6:6
2+
--> $DIR/const_drop_is_valid.rs:3:6
33
|
44
LL | impl const Drop for A {}
55
| ^^^^^
@@ -8,17 +8,8 @@ LL | impl const Drop for A {}
88
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
99
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
1010

11-
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
12-
--> $DIR/const_drop_is_valid.rs:1:12
13-
|
14-
LL | #![feature(effects)]
15-
| ^^^^^^^
16-
|
17-
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
18-
= note: `#[warn(incomplete_features)]` on by default
19-
2011
error: const `impl` for trait `Drop` which is not marked with `#[const_trait]`
21-
--> $DIR/const_drop_is_valid.rs:6:12
12+
--> $DIR/const_drop_is_valid.rs:3:12
2213
|
2314
LL | impl const Drop for A {}
2415
| ^^^^
@@ -27,14 +18,14 @@ LL | impl const Drop for A {}
2718
= note: adding a non-const method body in the future would be a breaking change
2819

2920
error[E0046]: not all trait items implemented, missing: `drop`
30-
--> $DIR/const_drop_is_valid.rs:6:1
21+
--> $DIR/const_drop_is_valid.rs:3:1
3122
|
3223
LL | impl const Drop for A {}
3324
| ^^^^^^^^^^^^^^^^^^^^^ missing `drop` in implementation
3425
|
3526
= help: implement the missing item: `fn drop(&mut self) { todo!() }`
3627

37-
error: aborting due to 3 previous errors; 1 warning emitted
28+
error: aborting due to 3 previous errors
3829

3930
Some errors have detailed explanations: E0046, E0658.
4031
For more information about an error, try `rustc --explain E0046`.

tests/ui/generic-const-items/const-trait-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@ compile-flags: -Znext-solver
33
// Test that we can call methods from const trait impls inside of generic const items.
44

5-
#![feature(generic_const_items, const_trait_impl, effects)]
5+
#![feature(generic_const_items, const_trait_impl)]
66
#![allow(incomplete_features)]
77
#![crate_type = "lib"]
88

tests/ui/intrinsics/safe-intrinsic-mismatch.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
//@ revisions: stock effects
21
#![feature(intrinsics)]
32
#![feature(rustc_attrs)]
4-
// as effects insert a const generic param to const intrinsics,
5-
// check here that it doesn't report a const param mismatch either
6-
// enabling or disabling effects.
7-
#![cfg_attr(effects, feature(effects))]
83
#![allow(incomplete_features)]
94

105
extern "rust-intrinsic" {
@@ -24,7 +19,6 @@ const fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {}
2419
mod foo {
2520
#[rustc_intrinsic]
2621
unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {}
27-
// FIXME(effects) ~^ ERROR wrong number of const parameters
2822
}
2923

3024
fn main() {}

tests/ui/intrinsics/safe-intrinsic-mismatch.effects.stderr renamed to tests/ui/intrinsics/safe-intrinsic-mismatch.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `size_of`
2-
--> $DIR/safe-intrinsic-mismatch.rs:11:5
2+
--> $DIR/safe-intrinsic-mismatch.rs:6:5
33
|
44
LL | fn size_of<T>() -> usize;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^
66

77
error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `size_of`
8-
--> $DIR/safe-intrinsic-mismatch.rs:11:5
8+
--> $DIR/safe-intrinsic-mismatch.rs:6:5
99
|
1010
LL | fn size_of<T>() -> usize;
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^
1212
|
1313
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1414

1515
error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `assume`
16-
--> $DIR/safe-intrinsic-mismatch.rs:16:1
16+
--> $DIR/safe-intrinsic-mismatch.rs:11:1
1717
|
1818
LL | const fn assume(_b: bool) {}
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^
2020

2121
error[E0308]: intrinsic has wrong type
22-
--> $DIR/safe-intrinsic-mismatch.rs:16:16
22+
--> $DIR/safe-intrinsic-mismatch.rs:11:16
2323
|
2424
LL | const fn assume(_b: bool) {}
2525
| ^ expected unsafe fn, found safe fn
@@ -28,13 +28,13 @@ LL | const fn assume(_b: bool) {}
2828
found signature `fn(_)`
2929

3030
error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `const_deallocate`
31-
--> $DIR/safe-intrinsic-mismatch.rs:20:1
31+
--> $DIR/safe-intrinsic-mismatch.rs:15:1
3232
|
3333
LL | const fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {}
3434
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3535

3636
error[E0308]: intrinsic has wrong type
37-
--> $DIR/safe-intrinsic-mismatch.rs:20:26
37+
--> $DIR/safe-intrinsic-mismatch.rs:15:26
3838
|
3939
LL | const fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {}
4040
| ^ expected unsafe fn, found safe fn

0 commit comments

Comments
 (0)