Skip to content

Commit 81da6a6

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

File tree

123 files changed

+774
-111
lines changed

Some content is hidden

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

123 files changed

+774
-111
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.

src/doc/unstable-book/src/language-features/intrinsics.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ All intrinsic fallback bodies are automatically made cross-crate inlineable (lik
1818
by the codegen backend, but not the MIR inliner.
1919

2020
```rust
21-
#![feature(rustc_attrs, effects)]
21+
#![feature(rustc_attrs)]
2222
#![allow(internal_features)]
2323

2424
#[rustc_intrinsic]
@@ -28,7 +28,7 @@ const unsafe fn const_deallocate(_ptr: *mut u8, _size: usize, _align: usize) {}
2828
Since these are just regular functions, it is perfectly ok to create the intrinsic twice:
2929

3030
```rust
31-
#![feature(rustc_attrs, effects)]
31+
#![feature(rustc_attrs)]
3232
#![allow(internal_features)]
3333

3434
#[rustc_intrinsic]

src/tools/miri/tests/fail/intrinsic_fallback_is_spec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(rustc_attrs, effects)]
1+
#![feature(rustc_attrs)]
22

33
#[rustc_intrinsic]
44
#[rustc_nounwind]

tests/rustdoc/const-effect-param.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#![crate_name = "foo"]
44
#![feature(effects, const_trait_impl)]
5+
#![allow(incomplete_features)]
56

67
#[const_trait]
78
pub trait Tr {

tests/rustdoc/const-fn-effects.rs

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

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

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

+11-10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// not remove this test.
88
//
99
// FIXME(effects) add `const_trait` to `Fn` so we use `~const`
10+
// FIXME(effects) restore `const_trait` to `Destruct`
1011
#![feature(const_trait_impl)]
1112
#![crate_name = "foo"]
1213

@@ -24,9 +25,9 @@ pub trait Tr<T> {
2425
// @has - '//section[@id="method.a"]/h4[@class="code-header"]/a[@class="trait"]' 'Fn'
2526
// @!has - '//section[@id="method.a"]/h4[@class="code-header"]/span[@class="where"]' '~const'
2627
// @has - '//section[@id="method.a"]/h4[@class="code-header"]/div[@class="where"]' ': Fn'
27-
fn a<A: /* ~const */ Fn() + ~const Destruct>()
28+
fn a<A: /* ~const */ Fn() /* + ~const Destruct */>()
2829
where
29-
Option<A>: /* ~const */ Fn() + ~const Destruct,
30+
Option<A>: /* ~const */ Fn() /* + ~const Destruct */,
3031
{
3132
}
3233
}
@@ -36,13 +37,13 @@ pub trait Tr<T> {
3637
// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/a[@class="trait"]' 'Fn'
3738
// @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/span[@class="where"]' '~const'
3839
// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/div[@class="where"]' ': Fn'
39-
impl<T: /* ~const */ Fn() + ~const Destruct> const Tr<T> for T
40+
impl<T: /* ~const */ Fn() /* + ~const Destruct */> const Tr<T> for T
4041
where
41-
Option<T>: /* ~const */ Fn() + ~const Destruct,
42+
Option<T>: /* ~const */ Fn() /* + ~const Destruct */,
4243
{
43-
fn a<A: /* ~const */ Fn() + ~const Destruct>()
44+
fn a<A: /* ~const */ Fn() /* + ~const Destruct */>()
4445
where
45-
Option<A>: /* ~const */ Fn() + ~const Destruct,
46+
Option<A>: /* ~const */ Fn() /* + ~const Destruct */,
4647
{
4748
}
4849
}
@@ -51,9 +52,9 @@ where
5152
// @has - '//pre[@class="rust item-decl"]/code/a[@class="trait"]' 'Fn'
5253
// @!has - '//pre[@class="rust item-decl"]/code/div[@class="where"]' '~const'
5354
// @has - '//pre[@class="rust item-decl"]/code/div[@class="where"]' ': Fn'
54-
pub const fn foo<F: /* ~const */ Fn() + ~const Destruct>()
55+
pub const fn foo<F: /* ~const */ Fn() /* + ~const Destruct */>()
5556
where
56-
Option<F>: /* ~const */ Fn() + ~const Destruct,
57+
Option<F>: /* ~const */ Fn() /* + ~const Destruct */,
5758
{
5859
F::a()
5960
}
@@ -63,9 +64,9 @@ impl<T> S<T> {
6364
// @has - '//section[@id="method.foo"]/h4[@class="code-header"]/a[@class="trait"]' 'Fn'
6465
// @!has - '//section[@id="method.foo"]/h4[@class="code-header"]/span[@class="where"]' '~const'
6566
// @has - '//section[@id="method.foo"]/h4[@class="code-header"]/div[@class="where"]' ': Fn'
66-
pub const fn foo<B, C: /* ~const */ Fn() + ~const Destruct>()
67+
pub const fn foo<B, C: /* ~const */ Fn() /* + ~const Destruct */>()
6768
where
68-
B: /* ~const */ Fn() + ~const Destruct,
69+
B: /* ~const */ Fn() /* + ~const Destruct */,
6970
{
7071
B::a()
7172
}

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+

0 commit comments

Comments
 (0)