Skip to content

Commit

Permalink
Make effects an incomplete feature
Browse files Browse the repository at this point in the history
  • Loading branch information
fee1-dead committed Jun 21, 2024
1 parent a6a83d3 commit f6f1a10
Show file tree
Hide file tree
Showing 118 changed files with 758 additions and 98 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ declare_features! (
/// Allows `dyn* Trait` objects.
(incomplete, dyn_star, "1.65.0", Some(102425)),
/// Uses generic effect parameters for ~const bounds
(unstable, effects, "1.72.0", Some(102090)),
(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/ui/const-generics/const_trait_fn-issue-88433.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ build-pass

#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete

#[const_trait]
trait Func<T> {
Expand Down
11 changes: 11 additions & 0 deletions tests/ui/const-generics/const_trait_fn-issue-88433.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const_trait_fn-issue-88433.rs:3:30
|
LL | #![feature(const_trait_impl, effects)]
| ^^^^^^^
|
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
= note: `#[warn(incomplete_features)]` on by default

warning: 1 warning emitted

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,5 +1,5 @@
#![crate_type = "lib"]
#![feature(const_closures, const_trait_impl, effects)]
#![feature(const_closures, const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete

pub const fn test() {
let cl = const || {};
Expand Down
11 changes: 10 additions & 1 deletion tests/ui/consts/const-float-classify.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-float-classify.rs:7:30
|
LL | #![feature(const_trait_impl, 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 `PartialEq` which is not marked with `#[const_trait]`
--> $DIR/const-float-classify.rs:12:12
|
Expand Down Expand Up @@ -208,7 +217,7 @@ LL | impl const PartialEq<NonDet> for bool {
| unsatisfied trait bound introduced here
= note: this error originates in the macro `const_assert` which comes from the expansion of the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info)

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

Some errors have detailed explanations: E0207, E0284.
For more information about an error, try `rustc --explain E0207`.
11 changes: 10 additions & 1 deletion tests/ui/consts/const_cmp_type_id.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const_cmp_type_id.rs:3:30
|
LL | #![feature(const_trait_impl, effects)]
| ^^^^^^^
|
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
= note: `#[warn(incomplete_features)]` on by default

error[E0131]: `main` function is not allowed to have generic parameters
--> $DIR/const_cmp_type_id.rs:7:14
|
Expand All @@ -10,7 +19,7 @@ error[E0080]: evaluation of constant value failed
LL | const _A: bool = TypeId::of::<u8>() < TypeId::of::<u16>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `<TypeId as PartialOrd>::lt`

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

Some errors have detailed explanations: E0080, E0131.
For more information about an error, try `rustc --explain E0080`.
11 changes: 10 additions & 1 deletion tests/ui/consts/rustc-impl-const-stability.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/rustc-impl-const-stability.rs:5:30
|
LL | #![feature(const_trait_impl, 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 `Default` which is not marked with `#[const_trait]`
--> $DIR/rustc-impl-const-stability.rs:15:12
|
Expand All @@ -16,6 +25,6 @@ LL | impl const Default for Data {
= note: expressions using a const parameter must map each value to a distinct output value
= note: proving the result of expressions other than the parameter are unique is not supported

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

For more information about this error, try `rustc --explain E0207`.
2 changes: 1 addition & 1 deletion tests/ui/parser/impls-nested-within-fns-semantic-1.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Regression test for part of issue #119924.
//@ check-pass

#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete

#[const_trait]
trait Trait {
Expand Down
11 changes: 11 additions & 0 deletions tests/ui/parser/impls-nested-within-fns-semantic-1.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/impls-nested-within-fns-semantic-1.rs:4:30
|
LL | #![feature(const_trait_impl, effects)]
| ^^^^^^^
|
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
= note: `#[warn(incomplete_features)]` on by default

warning: 1 warning emitted

Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/assoc-type-const-bound-usage-0.rs:6:30
|
LL | #![feature(const_trait_impl, effects)]
| ^^^^^^^
|
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
= note: `#[warn(incomplete_features)]` on by default

error[E0277]: the trait bound `T: Trait` is not satisfied
--> $DIR/assoc-type-const-bound-usage-0.rs:21:6
|
Expand All @@ -9,6 +18,6 @@ help: consider further restricting this bound
LL | const fn qualified<T: ~const Trait + Trait>() -> i32 {
| +++++++

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

For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//@[unqualified] check-pass
//@[qualified] known-bug: unknown

#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl, effects)] //[unqualified]~ WARN the feature `effects` is incomplete

#[const_trait]
trait Trait {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/assoc-type-const-bound-usage-0.rs:6:30
|
LL | #![feature(const_trait_impl, effects)]
| ^^^^^^^
|
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
= note: `#[warn(incomplete_features)]` on by default

warning: 1 warning emitted

2 changes: 1 addition & 1 deletion tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// FIXME(effects): Replace `Add` with `std::ops::Add` once the latter a `#[const_trait]` again.
#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete

#[const_trait]
trait Add<Rhs = Self> {
Expand Down
11 changes: 10 additions & 1 deletion tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/assoc-type.rs:2:30
|
LL | #![feature(const_trait_impl, effects)]
| ^^^^^^^
|
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
= note: `#[warn(incomplete_features)]` on by default

error[E0277]: the trait bound `NonConstAdd: ~const Add` is not satisfied
--> $DIR/assoc-type.rs:35:16
|
Expand All @@ -11,6 +20,6 @@ note: required by a bound in `Foo::Bar`
LL | type Bar: ~const Add;
| ^^^^^^^^^^ required by this bound in `Foo::Bar`

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

For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete

#[const_trait]
pub trait MyTrait {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete
#![feature(staged_api)]
#![stable(feature = "rust1", since = "1.0.0")]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete

#[const_trait]
pub trait Plus {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/call-const-trait-method-fail.rs:1:30
|
LL | #![feature(const_trait_impl, effects)]
| ^^^^^^^
|
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
= note: `#[warn(incomplete_features)]` on by default

error[E0277]: the trait bound `u32: ~const Plus` is not satisfied
--> $DIR/call-const-trait-method-fail.rs:25:5
|
Expand All @@ -6,6 +15,6 @@ LL | a.plus(b)
|
= help: the trait `Plus` is implemented for `u32`

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

For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/call-generic-method-chain.rs:6:30
|
LL | #![feature(const_trait_impl, 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 `PartialEq` which is not marked with `#[const_trait]`
--> $DIR/call-generic-method-chain.rs:10:12
|
Expand Down Expand Up @@ -56,7 +65,7 @@ LL | impl const PartialEq for S {
| |
| unsatisfied trait bound introduced here

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

Some errors have detailed explanations: E0207, E0284.
For more information about an error, try `rustc --explain E0207`.
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/call-generic-method-dup-bound.rs:4:30
|
LL | #![feature(const_trait_impl, 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 `PartialEq` which is not marked with `#[const_trait]`
--> $DIR/call-generic-method-dup-bound.rs:8:12
|
Expand Down Expand Up @@ -70,7 +79,7 @@ LL | impl const PartialEq for S {
| |
| unsatisfied trait bound introduced here

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

Some errors have detailed explanations: E0207, E0284.
For more information about an error, try `rustc --explain E0207`.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ check-pass

#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete

pub const fn equals_self<T: PartialEq>(t: &T) -> bool {
*t == *t
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/call-generic-method-fail.rs:3:30
|
LL | #![feature(const_trait_impl, effects)]
| ^^^^^^^
|
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
= note: `#[warn(incomplete_features)]` on by default

warning: 1 warning emitted

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete

struct S;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/call-generic-method-nonconst.rs:1:30
|
LL | #![feature(const_trait_impl, effects)]
| ^^^^^^^
|
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
= note: `#[warn(incomplete_features)]` on by default

error[E0277]: the trait bound `S: const Foo` is not satisfied
--> $DIR/call-generic-method-nonconst.rs:23:34
|
Expand All @@ -13,6 +22,6 @@ note: required by a bound in `equals_self`
LL | const fn equals_self<T: ~const Foo>(t: &T) -> bool {
| ^^^^^^^^^^ required by this bound in `equals_self`

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

For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/call-generic-method-pass.rs:6:30
|
LL | #![feature(const_trait_impl, 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 `PartialEq` which is not marked with `#[const_trait]`
--> $DIR/call-generic-method-pass.rs:10:12
|
Expand Down Expand Up @@ -50,7 +59,7 @@ LL | impl const PartialEq for S {
| |
| unsatisfied trait bound introduced here

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

Some errors have detailed explanations: E0207, E0284.
For more information about an error, try `rustc --explain E0207`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Regression test for issue #117244.
#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete

trait NonConst {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-bounds-non-const-trait.rs:2:30
|
LL | #![feature(const_trait_impl, 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` can only be applied to `#[const_trait]` traits
--> $DIR/const-bounds-non-const-trait.rs:6:28
|
Expand All @@ -10,5 +19,5 @@ error: `const` can only be applied to `#[const_trait]` traits
LL | fn operate<T: const NonConst>() {}
| ^^^^^^^^

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(const_trait_impl, effects)]
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete

struct S;
#[const_trait]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-check-fns-in-const-impl.rs:1:30
|
LL | #![feature(const_trait_impl, effects)]
| ^^^^^^^
|
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
= note: `#[warn(incomplete_features)]` on by default

error[E0015]: cannot call non-const fn `non_const` in constant functions
--> $DIR/const-check-fns-in-const-impl.rs:12:16
|
Expand All @@ -6,6 +15,6 @@ LL | fn foo() { non_const() }
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants

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

For more information about this error, try `rustc --explain E0015`.
Loading

0 comments on commit f6f1a10

Please sign in to comment.