Skip to content

Commit f6f1a10

Browse files
committed
Make effects an incomplete feature
1 parent a6a83d3 commit f6f1a10

File tree

118 files changed

+758
-98
lines changed

Some content is hidden

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

118 files changed

+758
-98
lines changed

compiler/rustc_feature/src/unstable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ declare_features! (
449449
/// Allows `dyn* Trait` objects.
450450
(incomplete, dyn_star, "1.65.0", Some(102425)),
451451
/// Uses generic effect parameters for ~const bounds
452-
(unstable, effects, "1.72.0", Some(102090)),
452+
(incomplete, effects, "1.72.0", Some(102090)),
453453
/// Allows exhaustive pattern matching on types that contain uninhabited types.
454454
(unstable, exhaustive_patterns, "1.13.0", Some(51085)),
455455
/// Allows explicit tail calls via `become` expression.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ build-pass
22

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

55
#[const_trait]
66
trait Func<T> {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/const_trait_fn-issue-88433.rs:3:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
10+
warning: 1 warning emitted
11+

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![crate_type = "lib"]
2-
#![feature(const_closures, const_trait_impl, effects)]
2+
#![feature(const_closures, const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete
33

44
pub const fn test() {
55
let cl = const || {};

tests/ui/consts/const-float-classify.stderr

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/const-float-classify.rs:7:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
110
error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]`
211
--> $DIR/const-float-classify.rs:12:12
312
|
@@ -208,7 +217,7 @@ LL | impl const PartialEq<NonDet> for bool {
208217
| unsatisfied trait bound introduced here
209218
= 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)
210219

211-
error: aborting due to 10 previous errors
220+
error: aborting due to 10 previous errors; 1 warning emitted
212221

213222
Some errors have detailed explanations: E0207, E0284.
214223
For more information about an error, try `rustc --explain E0207`.

tests/ui/consts/const_cmp_type_id.stderr

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/const_cmp_type_id.rs:3:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
110
error[E0131]: `main` function is not allowed to have generic parameters
211
--> $DIR/const_cmp_type_id.rs:7:14
312
|
@@ -10,7 +19,7 @@ error[E0080]: evaluation of constant value failed
1019
LL | const _A: bool = TypeId::of::<u8>() < TypeId::of::<u16>();
1120
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `<TypeId as PartialOrd>::lt`
1221

13-
error: aborting due to 2 previous errors
22+
error: aborting due to 2 previous errors; 1 warning emitted
1423

1524
Some errors have detailed explanations: E0080, E0131.
1625
For more information about an error, try `rustc --explain E0080`.

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

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/rustc-impl-const-stability.rs:5:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
110
error: const `impl` for trait `Default` which is not marked with `#[const_trait]`
211
--> $DIR/rustc-impl-const-stability.rs:15:12
312
|
@@ -16,6 +25,6 @@ LL | impl const Default for Data {
1625
= note: expressions using a const parameter must map each value to a distinct output value
1726
= note: proving the result of expressions other than the parameter are unique is not supported
1827

19-
error: aborting due to 2 previous errors
28+
error: aborting due to 2 previous errors; 1 warning emitted
2029

2130
For more information about this error, try `rustc --explain E0207`.

tests/ui/parser/impls-nested-within-fns-semantic-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Regression test for part of issue #119924.
22
//@ check-pass
33

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

66
#[const_trait]
77
trait Trait {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/impls-nested-within-fns-semantic-1.rs:4:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
10+
warning: 1 warning emitted
11+

tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.qualified.stderr

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/assoc-type-const-bound-usage-0.rs:6:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
110
error[E0277]: the trait bound `T: Trait` is not satisfied
211
--> $DIR/assoc-type-const-bound-usage-0.rs:21:6
312
|
@@ -9,6 +18,6 @@ help: consider further restricting this bound
918
LL | const fn qualified<T: ~const Trait + Trait>() -> i32 {
1019
| +++++++
1120

12-
error: aborting due to 1 previous error
21+
error: aborting due to 1 previous error; 1 warning emitted
1322

1423
For more information about this error, try `rustc --explain E0277`.

tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage-0.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@[unqualified] check-pass
44
//@[qualified] known-bug: unknown
55

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

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

tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// FIXME(effects): Replace `Add` with `std::ops::Add` once the latter a `#[const_trait]` again.
2-
#![feature(const_trait_impl, effects)]
2+
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete
33

44
#[const_trait]
55
trait Add<Rhs = Self> {

tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.stderr

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/assoc-type.rs:2:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
110
error[E0277]: the trait bound `NonConstAdd: ~const Add` is not satisfied
211
--> $DIR/assoc-type.rs:35:16
312
|
@@ -11,6 +20,6 @@ note: required by a bound in `Foo::Bar`
1120
LL | type Bar: ~const Add;
1221
| ^^^^^^^^^^ required by this bound in `Foo::Bar`
1322

14-
error: aborting due to 1 previous error
23+
error: aborting due to 1 previous error; 1 warning emitted
1524

1625
For more information about this error, try `rustc --explain E0277`.

tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs

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

33
#[const_trait]
44
pub trait MyTrait {

tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/staged-api.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_trait_impl, effects)]
1+
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete
22
#![feature(staged_api)]
33
#![stable(feature = "rust1", since = "1.0.0")]
44

tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs

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

33
#[const_trait]
44
pub trait Plus {
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/call-const-trait-method-fail.rs:1:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
110
error[E0277]: the trait bound `u32: ~const Plus` is not satisfied
211
--> $DIR/call-const-trait-method-fail.rs:25:5
312
|
@@ -6,6 +15,6 @@ LL | a.plus(b)
615
|
716
= help: the trait `Plus` is implemented for `u32`
817

9-
error: aborting due to 1 previous error
18+
error: aborting due to 1 previous error; 1 warning emitted
1019

1120
For more information about this error, try `rustc --explain E0277`.

tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/call-generic-method-chain.rs:6:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
110
error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]`
211
--> $DIR/call-generic-method-chain.rs:10:12
312
|
@@ -56,7 +65,7 @@ LL | impl const PartialEq for S {
5665
| |
5766
| unsatisfied trait bound introduced here
5867

59-
error: aborting due to 6 previous errors
68+
error: aborting due to 6 previous errors; 1 warning emitted
6069

6170
Some errors have detailed explanations: E0207, E0284.
6271
For more information about an error, try `rustc --explain E0207`.

tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/call-generic-method-dup-bound.rs:4:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
110
error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]`
211
--> $DIR/call-generic-method-dup-bound.rs:8:12
312
|
@@ -70,7 +79,7 @@ LL | impl const PartialEq for S {
7079
| |
7180
| unsatisfied trait bound introduced here
7281

73-
error: aborting due to 7 previous errors
82+
error: aborting due to 7 previous errors; 1 warning emitted
7483

7584
Some errors have detailed explanations: E0207, E0284.
7685
For more information about an error, try `rustc --explain E0207`.

tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ check-pass
22

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

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

tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs

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

33
struct S;
44

tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/call-generic-method-nonconst.rs:1:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
110
error[E0277]: the trait bound `S: const Foo` is not satisfied
211
--> $DIR/call-generic-method-nonconst.rs:23:34
312
|
@@ -13,6 +22,6 @@ note: required by a bound in `equals_self`
1322
LL | const fn equals_self<T: ~const Foo>(t: &T) -> bool {
1423
| ^^^^^^^^^^ required by this bound in `equals_self`
1524

16-
error: aborting due to 1 previous error
25+
error: aborting due to 1 previous error; 1 warning emitted
1726

1827
For more information about this error, try `rustc --explain E0277`.

tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/call-generic-method-pass.rs:6:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
110
error: const `impl` for trait `PartialEq` which is not marked with `#[const_trait]`
211
--> $DIR/call-generic-method-pass.rs:10:12
312
|
@@ -50,7 +59,7 @@ LL | impl const PartialEq for S {
5059
| |
5160
| unsatisfied trait bound introduced here
5261

53-
error: aborting due to 5 previous errors
62+
error: aborting due to 5 previous errors; 1 warning emitted
5463

5564
Some errors have detailed explanations: E0207, E0284.
5665
For more information about an error, try `rustc --explain E0207`.

tests/ui/rfcs/rfc-2632-const-trait-impl/const-bounds-non-const-trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Regression test for issue #117244.
2-
#![feature(const_trait_impl, effects)]
2+
#![feature(const_trait_impl, effects)] //~ WARN the feature `effects` is incomplete
33

44
trait NonConst {}
55

tests/ui/rfcs/rfc-2632-const-trait-impl/const-bounds-non-const-trait.stderr

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/const-bounds-non-const-trait.rs:2:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
110
error: `~const` can only be applied to `#[const_trait]` traits
211
--> $DIR/const-bounds-non-const-trait.rs:6:28
312
|
@@ -10,5 +19,5 @@ error: `const` can only be applied to `#[const_trait]` traits
1019
LL | fn operate<T: const NonConst>() {}
1120
| ^^^^^^^^
1221

13-
error: aborting due to 2 previous errors
22+
error: aborting due to 2 previous errors; 1 warning emitted
1423

tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs

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

33
struct S;
44
#[const_trait]
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
warning: the feature `effects` is incomplete and may not be safe to use and/or cause compiler crashes
2+
--> $DIR/const-check-fns-in-const-impl.rs:1:30
3+
|
4+
LL | #![feature(const_trait_impl, effects)]
5+
| ^^^^^^^
6+
|
7+
= note: see issue #102090 <https://github.com/rust-lang/rust/issues/102090> for more information
8+
= note: `#[warn(incomplete_features)]` on by default
9+
110
error[E0015]: cannot call non-const fn `non_const` in constant functions
211
--> $DIR/const-check-fns-in-const-impl.rs:12:16
312
|
@@ -6,6 +15,6 @@ LL | fn foo() { non_const() }
615
|
716
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
817

9-
error: aborting due to 1 previous error
18+
error: aborting due to 1 previous error; 1 warning emitted
1019

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

0 commit comments

Comments
 (0)