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

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.

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

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

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

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`.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy