Skip to content

Commit

Permalink
Yeet effects feature
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Nov 2, 2024
1 parent a31978c commit 505d833
Show file tree
Hide file tree
Showing 176 changed files with 278 additions and 751 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_feature/src/removed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ declare_features! (
Some("renamed to `doc_notable_trait`")),
/// Allows using `#[unsafe_destructor_blind_to_params]` (RFC 1238).
(removed, dropck_parametricity, "1.38.0", Some(28498), None),
/// Uses generic effect parameters for ~const bounds
(removed, effects, "CURRENT_RUSTC_VERSION", Some(102090),
Some("removed, redundant with `#![feature(const_trait_impl)]`")),
/// Allows defining `existential type`s.
(removed, existential_type, "1.38.0", Some(63063),
Some("removed in favor of `#![feature(type_alias_impl_trait)]`")),
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,6 @@ declare_features! (
(unstable, doc_masked, "1.21.0", Some(44027)),
/// Allows `dyn* Trait` objects.
(incomplete, dyn_star, "1.65.0", Some(102425)),
/// Uses generic effect parameters for ~const bounds
(incomplete, effects, "1.72.0", Some(102090)),
/// Allows exhaustive pattern matching on types that contain uninhabited types.
(unstable, exhaustive_patterns, "1.13.0", Some(51085)),
/// Allows explicit tail calls via `become` expression.
Expand Down
2 changes: 1 addition & 1 deletion tests/crashes/112623.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ known-bug: #112623

#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl)]

#[const_trait]
trait Value {
Expand Down
2 changes: 1 addition & 1 deletion tests/crashes/119701.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ known-bug: #119701
#![feature(const_trait_impl, effects, generic_const_exprs)]
#![feature(const_trait_impl, generic_const_exprs)]

fn main() {
let _ = process::<()>([()]);
Expand Down
2 changes: 1 addition & 1 deletion tests/crashes/121411.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ known-bug: #121411
#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl)]

#[const_trait]
trait Foo {
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc/const-effect-param.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Check that we don't render host effect parameters & arguments.

#![crate_name = "foo"]
#![feature(effects, const_trait_impl)]
#![feature(const_trait_impl)]
#![allow(incomplete_features)]

#[const_trait]
Expand Down
2 changes: 0 additions & 2 deletions tests/rustdoc/const-fn-effects.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![crate_name = "foo"]
#![feature(effects)]
#![allow(incomplete_features)]

//@ has foo/fn.bar.html
//@ has - '//pre[@class="rust item-decl"]' 'pub const fn bar() -> '
Expand Down
3 changes: 1 addition & 2 deletions tests/rustdoc/inline_cross/auxiliary/const-effect-param.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//@ compile-flags: -Znext-solver
#![feature(effects, const_trait_impl)]
#![allow(incomplete_features)]
#![feature(const_trait_impl)]

#[const_trait]
pub trait Resource {}
Expand Down
2 changes: 1 addition & 1 deletion tests/rustdoc/rfc-2632-const-trait-impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// FIXME(effects) add `const_trait` to `Fn` so we use `~const`
// FIXME(effects) restore `const_trait` to `Destruct`
#![allow(incomplete_features)]
#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl)]
#![crate_name = "foo"]

use std::marker::Destruct;
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/const-generics/const_trait_fn-issue-88433.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//@ build-pass
//@ compile-flags: -Znext-solver

#![allow(incomplete_features)]
#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl)]

#[const_trait]
trait Func<T> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ known-bug: #110395
//@ compile-flags: -Znext-solver
#![feature(generic_const_exprs, adt_const_params, const_trait_impl, effects)]
#![feature(generic_const_exprs, adt_const_params, const_trait_impl)]
#![allow(incomplete_features)]

// test `N + N` unifies with explicit function calls for non-builtin-types
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error: `-Znext-solver=globally` and `generic_const_exprs` are incompatible, using them at the same time is not allowed
--> $DIR/unify-op-with-fn-call.rs:3:12
|
LL | #![feature(generic_const_exprs, adt_const_params, const_trait_impl, effects)]
LL | #![feature(generic_const_exprs, adt_const_params, const_trait_impl)]
| ^^^^^^^^^^^^^^^^^^^
|
= help: remove one of these features
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/const-generics/issues/issue-88119.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ known-bug: #110395
//@ compile-flags: -Znext-solver
#![allow(incomplete_features)]
#![feature(const_trait_impl, effects, generic_const_exprs)]
#![feature(const_trait_impl, generic_const_exprs)]

#[const_trait]
trait ConstName {
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/const-generics/issues/issue-88119.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: `-Znext-solver=globally` and `generic_const_exprs` are incompatible, using them at the same time is not allowed
--> $DIR/issue-88119.rs:4:39
--> $DIR/issue-88119.rs:4:30
|
LL | #![feature(const_trait_impl, effects, generic_const_exprs)]
| ^^^^^^^^^^^^^^^^^^^
LL | #![feature(const_trait_impl, generic_const_exprs)]
| ^^^^^^^^^^^^^^^^^^^
|
= help: remove one of these features

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/auxiliary/closure-in-foreign-crate.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ compile-flags: -Znext-solver
#![crate_type = "lib"]
#![feature(const_closures, const_trait_impl, effects)]
#![feature(const_closures, const_trait_impl)]
#![allow(incomplete_features)]

pub const fn test() {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/const-try.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#![crate_type = "lib"]
#![feature(try_trait_v2)]
#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl)]
#![feature(const_try)]
#![allow(incomplete_features)]

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/const_cmp_type_id.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ compile-flags: -Znext-solver
#![feature(const_type_id, const_trait_impl, effects)]
#![feature(const_type_id, const_trait_impl)]
#![allow(incomplete_features)]

use std::any::TypeId;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/constifconst-call-in-const-position.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ known-bug: #102498

#![feature(const_trait_impl, effects, generic_const_exprs)]
#![feature(const_trait_impl, generic_const_exprs)]
#![allow(incomplete_features)]

#[const_trait]
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/rustc-impl-const-stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ known-bug: #110395

#![crate_type = "lib"]
#![feature(staged_api, const_trait_impl, effects)]
#![feature(staged_api, const_trait_impl)]
#![allow(incomplete_features)]
#![stable(feature = "foo", since = "1.0.0")]

Expand Down
1 change: 0 additions & 1 deletion tests/ui/delegation/unsupported.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![feature(const_trait_impl)]
#![feature(c_variadic)]
#![feature(effects)]
#![feature(fn_delegation)]
#![allow(incomplete_features)]

Expand Down
36 changes: 18 additions & 18 deletions tests/ui/delegation/unsupported.stderr
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:26:5: 26:24>::{synthetic#0}`
--> $DIR/unsupported.rs:27:25
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:25:5: 25:24>::{synthetic#0}`
--> $DIR/unsupported.rs:26:25
|
LL | reuse to_reuse::opaque_ret;
| ^^^^^^^^^^
|
note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process...
--> $DIR/unsupported.rs:27:25
--> $DIR/unsupported.rs:26:25
|
LL | reuse to_reuse::opaque_ret;
| ^^^^^^^^^^
= note: ...which again requires computing type of `opaque::<impl at $DIR/unsupported.rs:26:5: 26:24>::{synthetic#0}`, completing the cycle
note: cycle used when checking that `opaque::<impl at $DIR/unsupported.rs:26:5: 26:24>` is well-formed
--> $DIR/unsupported.rs:26:5
= note: ...which again requires computing type of `opaque::<impl at $DIR/unsupported.rs:25:5: 25:24>::{synthetic#0}`, completing the cycle
note: cycle used when checking that `opaque::<impl at $DIR/unsupported.rs:25:5: 25:24>` is well-formed
--> $DIR/unsupported.rs:25:5
|
LL | impl ToReuse for u8 {
| ^^^^^^^^^^^^^^^^^^^
= 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

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

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

error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:29:5: 29:25>::{synthetic#0}`
--> $DIR/unsupported.rs:30:24
error[E0391]: cycle detected when computing type of `opaque::<impl at $DIR/unsupported.rs:28:5: 28:25>::{synthetic#0}`
--> $DIR/unsupported.rs:29:24
|
LL | reuse ToReuse::opaque_ret;
| ^^^^^^^^^^
|
note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process...
--> $DIR/unsupported.rs:30:24
--> $DIR/unsupported.rs:29:24
|
LL | reuse ToReuse::opaque_ret;
| ^^^^^^^^^^
= note: ...which again requires computing type of `opaque::<impl at $DIR/unsupported.rs:29:5: 29:25>::{synthetic#0}`, completing the cycle
note: cycle used when checking that `opaque::<impl at $DIR/unsupported.rs:29:5: 29:25>` is well-formed
--> $DIR/unsupported.rs:29:5
= note: ...which again requires computing type of `opaque::<impl at $DIR/unsupported.rs:28:5: 28:25>::{synthetic#0}`, completing the cycle
note: cycle used when checking that `opaque::<impl at $DIR/unsupported.rs:28:5: 28:25>` is well-formed
--> $DIR/unsupported.rs:28:5
|
LL | impl ToReuse for u16 {
| ^^^^^^^^^^^^^^^^^^^^
= 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

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

error[E0283]: type annotations needed
--> $DIR/unsupported.rs:53:18
--> $DIR/unsupported.rs:52:18
|
LL | reuse Trait::foo;
| ^^^ cannot infer type
Expand Down
3 changes: 0 additions & 3 deletions tests/ui/dropck/const_drop_is_valid.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#![feature(effects)]
//~^ WARN: the feature `effects` is incomplete

struct A();

impl const Drop for A {}
Expand Down
17 changes: 4 additions & 13 deletions tests/ui/dropck/const_drop_is_valid.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: const trait impls are experimental
--> $DIR/const_drop_is_valid.rs:6:6
--> $DIR/const_drop_is_valid.rs:3:6
|
LL | impl const Drop for A {}
| ^^^^^
Expand All @@ -8,17 +8,8 @@ LL | impl const Drop for A {}
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const_drop_is_valid.rs:1:12
|
LL | #![feature(effects)]
| ^^^^^^^
|
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
= note: `#[warn(incomplete_features)]` on by default

error: const `impl` for trait `Drop` which is not marked with `#[const_trait]`
--> $DIR/const_drop_is_valid.rs:6:12
--> $DIR/const_drop_is_valid.rs:3:12
|
LL | impl const Drop for A {}
| ^^^^
Expand All @@ -27,14 +18,14 @@ LL | impl const Drop for A {}
= note: adding a non-const method body in the future would be a breaking change

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

error: aborting due to 3 previous errors; 1 warning emitted
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0046, E0658.
For more information about an error, try `rustc --explain E0046`.
2 changes: 1 addition & 1 deletion tests/ui/generic-const-items/const-trait-impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ compile-flags: -Znext-solver
// Test that we can call methods from const trait impls inside of generic const items.

#![feature(generic_const_items, const_trait_impl, effects)]
#![feature(generic_const_items, const_trait_impl)]
#![allow(incomplete_features)]
#![crate_type = "lib"]

Expand Down
6 changes: 0 additions & 6 deletions tests/ui/intrinsics/safe-intrinsic-mismatch.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
//@ revisions: stock effects
#![feature(intrinsics)]
#![feature(rustc_attrs)]
// as effects insert a const generic param to const intrinsics,
// check here that it doesn't report a const param mismatch either
// enabling or disabling effects.
#![cfg_attr(effects, feature(effects))]
#![allow(incomplete_features)]

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

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

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

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

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

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

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

0 comments on commit 505d833

Please sign in to comment.