Skip to content

Commit d7104dc

Browse files
committed
Make feature flag incomplete
1 parent 5a6d00c commit d7104dc

29 files changed

+43
-25
lines changed

compiler/rustc_feature/src/unstable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ declare_features! (
474474
/// Allows `dyn* Trait` objects.
475475
(incomplete, dyn_star, "1.65.0", Some(102425)),
476476
/// Allows the .use postfix syntax `x.use` and use closures `use |x| { ... }`
477-
(unstable, ergonomic_clones, "CURRENT_RUSTC_VERSION", Some(132290)),
477+
(incomplete, ergonomic_clones, "CURRENT_RUSTC_VERSION", Some(132290)),
478478
/// Allows exhaustive pattern matching on types that contain uninhabited types.
479479
(unstable, exhaustive_patterns, "1.13.0", Some(51085)),
480480
/// Allows explicit tail calls via `become` expression.

tests/ui/ergonomic-clones/async/basic.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//@ edition:2018
33

44
#![feature(ergonomic_clones)]
5+
#![allow(incomplete_features)]
56

67
use std::future::Future;
78

tests/ui/ergonomic-clones/async/edition-2015.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(ergonomic_clones)]
2+
#![allow(incomplete_features)]
23

34
fn main() {
45
async use {};

tests/ui/ergonomic-clones/async/edition-2015.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `async use` blocks are only allowed in Rust 2018 or later
2-
--> $DIR/edition-2015.rs:4:5
2+
--> $DIR/edition-2015.rs:5:5
33
|
44
LL | async use {};
55
| ^^^^^^^^^

tests/ui/ergonomic-clones/async/local-type.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//@ edition:2018
33

44
#![feature(ergonomic_clones)]
5+
#![allow(incomplete_features)]
56

67
fn main() {
78
let _ = async use |x: x| x; //~ ERROR expected type

tests/ui/ergonomic-clones/async/local-type.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0573]: expected type, found local variable `x`
2-
--> $DIR/local-type.rs:7:27
2+
--> $DIR/local-type.rs:8:27
33
|
44
LL | let _ = async use |x: x| x;
55
| ^ not a type
66

77
error[E0573]: expected type, found local variable `x`
8-
--> $DIR/local-type.rs:8:36
8+
--> $DIR/local-type.rs:9:36
99
|
1010
LL | let _ = async use |x: bool| -> x { x };
1111
| ^ not a type

tests/ui/ergonomic-clones/closure/basic.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ check-pass
22

33
#![feature(ergonomic_clones)]
4+
#![allow(incomplete_features)]
45

56
use std::clone::UseCloned;
67
use std::future::Future;

tests/ui/ergonomic-clones/closure/fn-once.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(ergonomic_clones)]
2+
#![allow(incomplete_features)]
23

34
fn get_closure() -> Box<dyn Fn() -> Vec<u8>> {
45
let vec = vec![1u8, 2u8];

tests/ui/ergonomic-clones/closure/fn-once.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
2-
--> $DIR/fn-once.rs:6:19
2+
--> $DIR/fn-once.rs:7:19
33
|
44
LL | let closure = use || {
55
| ^^^^^^ this closure implements `FnOnce`, not `Fn`
@@ -9,7 +9,7 @@ LL | vec
99
LL | Box::new(closure)
1010
| ----------------- the requirement to implement `Fn` derives from here
1111
|
12-
= note: required for the cast from `Box<{closure@$DIR/fn-once.rs:6:19: 6:25}>` to `Box<(dyn Fn() -> Vec<u8> + 'static)>`
12+
= note: required for the cast from `Box<{closure@$DIR/fn-once.rs:7:19: 7:25}>` to `Box<(dyn Fn() -> Vec<u8> + 'static)>`
1313

1414
error: aborting due to 1 previous error
1515

tests/ui/ergonomic-clones/closure/immutable-outer-variable.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Point at the captured immutable outer variable
44

55
#![feature(ergonomic_clones)]
6+
#![allow(incomplete_features)]
67

78
fn foo(mut f: Box<dyn FnMut()>) {
89
f();

0 commit comments

Comments
 (0)