Skip to content

Commit 18e400f

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

File tree

121 files changed

+771
-108
lines changed

Some content is hidden

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

121 files changed

+771
-108
lines changed

compiler/rustc_feature/src/unstable.rs

Lines changed: 1 addition & 1 deletion
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/rustdoc/const-effect-param.rs

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 11 additions & 10 deletions
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

Lines changed: 1 addition & 1 deletion
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> {
Lines changed: 11 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 10 additions & 1 deletion
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

Lines changed: 10 additions & 1 deletion
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

Lines changed: 10 additions & 1 deletion
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`.

0 commit comments

Comments
 (0)