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

+1-1
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

+1
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

+1
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

+1-1
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

+1
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

+2-2
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

+1
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

+1
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

+2-2
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

+1
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();

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

+1
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();

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0594]: cannot assign to `y`, as it is not declared as mutable
2-
--> $DIR/immutable-outer-variable.rs:13:25
2+
--> $DIR/immutable-outer-variable.rs:14:25
33
|
44
LL | foo(Box::new(use || y = !y) as Box<_>);
55
| ^^^^^^ cannot assign

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

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Check that using the parameter name in its type does not ICE.
22

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

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

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

+2-2
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:6:21
2+
--> $DIR/local-type.rs:7:21
33
|
44
LL | let _ = use |x: x| x;
55
| ^ not a type
66

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

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

+1
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
fn main() {
67
let mut my_var = false;

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

+1
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
let mut my_var = false;

tests/ui/ergonomic-clones/closure/mutation2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0596]: cannot borrow `callback` as mutable, as it is not declared as mutable
2-
--> $DIR/mutation2.rs:8:5
2+
--> $DIR/mutation2.rs:9:5
33
|
44
LL | my_var = true;
55
| ------ calling `callback` requires mutable binding due to possible mutation of `my_var`

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

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

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

56
use std::clone::UseCloned;
67

tests/ui/ergonomic-clones/closure/once-move-out-on-heap.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Testing guarantees provided by once functions.
33

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

67
use std::sync::Arc;
78

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

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(ergonomic_clones)]
2+
#![allow(incomplete_features)]
23

34
fn parse1() {
45
|| use {

tests/ui/ergonomic-clones/closure/parse.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected one of `async`, `|`, or `||`, found `{`
2-
--> $DIR/parse.rs:4:12
2+
--> $DIR/parse.rs:5:12
33
|
44
LL | || use {
55
| -- ^ expected one of `async`, `|`, or `||`
@@ -13,13 +13,13 @@ LL ~ || { use {
1313
|
1414

1515
error: expected one of `async`, `|`, or `||`, found keyword `use`
16-
--> $DIR/parse.rs:10:10
16+
--> $DIR/parse.rs:11:10
1717
|
1818
LL | move use || {
1919
| ^^^ expected one of `async`, `|`, or `||`
2020

2121
error: expected one of `async`, `|`, or `||`, found keyword `move`
22-
--> $DIR/parse.rs:16:9
22+
--> $DIR/parse.rs:17:9
2323
|
2424
LL | use move || {
2525
| ^^^^ expected one of `async`, `|`, or `||`

tests/ui/ergonomic-clones/closure/print-verbose.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ compile-flags: -Zverbose-internals
22

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

56
fn to_fn_once<F: FnOnce()>(f: F) -> F {
67
f

tests/ui/ergonomic-clones/closure/print-verbose.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0382]: use of moved value: `c`
2-
--> $DIR/print-verbose.rs:21:5
2+
--> $DIR/print-verbose.rs:22:5
33
|
44
LL | let c = to_fn_once(use || {
55
| - move occurs because `c` has type `{f<T>::{closure#0} closure_kind_ty=i32 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=(Foo<&'?9 str>, T)}`, which does not implement the `Copy` trait
@@ -10,7 +10,7 @@ LL | c();
1010
| ^ value used here after move
1111
|
1212
note: this value implements `FnOnce`, which causes it to be moved when called
13-
--> $DIR/print-verbose.rs:20:5
13+
--> $DIR/print-verbose.rs:21:5
1414
|
1515
LL | c();
1616
| ^

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

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(ergonomic_clones)]
2+
#![allow(incomplete_features)]
23

34
fn to_fn_once<F: FnOnce()>(f: F) -> F {
45
f

tests/ui/ergonomic-clones/closure/print.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
error[E0382]: use of moved value: `c`
2-
--> $DIR/print.rs:19:5
2+
--> $DIR/print.rs:20:5
33
|
44
LL | let c = to_fn_once(use || {
5-
| - move occurs because `c` has type `{closure@$DIR/print.rs:14:24: 14:30}`, which does not implement the `Copy` trait
5+
| - move occurs because `c` has type `{closure@$DIR/print.rs:15:24: 15:30}`, which does not implement the `Copy` trait
66
...
77
LL | c();
88
| --- `c` moved due to this call
99
LL | c();
1010
| ^ value used here after move
1111
|
1212
note: this value implements `FnOnce`, which causes it to be moved when called
13-
--> $DIR/print.rs:18:5
13+
--> $DIR/print.rs:19:5
1414
|
1515
LL | c();
1616
| ^

tests/ui/ergonomic-clones/closure/with-binders.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

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

78
fn main() {
89
for<'a> use || -> () {};

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

+1
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

tests/ui/ergonomic-clones/dotuse/parse.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![feature(ergonomic_clones)]
2+
#![allow(incomplete_features)]
23

34
fn parse1() {
45
1.use!;

tests/ui/ergonomic-clones/dotuse/parse.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `!`
2-
--> $DIR/parse.rs:4:10
2+
--> $DIR/parse.rs:5:10
33
|
44
LL | 1.use!;
55
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
66

77
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `!`
8-
--> $DIR/parse.rs:9:10
8+
--> $DIR/parse.rs:10:10
99
|
1010
LL | 1.use!(2);
1111
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
1212

1313
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `2`
14-
--> $DIR/parse.rs:14:11
14+
--> $DIR/parse.rs:15:11
1515
|
1616
LL | 1.use 2;
1717
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
1818

1919
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `2`
20-
--> $DIR/parse.rs:19:12
20+
--> $DIR/parse.rs:20:12
2121
|
2222
LL | 1.use? 2;
2323
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
2424

2525
error: incorrect use of `use`
26-
--> $DIR/parse.rs:24:10
26+
--> $DIR/parse.rs:25:10
2727
|
2828
LL | 1.use();
2929
| ^^
@@ -35,13 +35,13 @@ LL + 1.use;
3535
|
3636

3737
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
38-
--> $DIR/parse.rs:34:11
38+
--> $DIR/parse.rs:35:11
3939
|
4040
LL | 1.use { 2 };
4141
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
4242

4343
error[E0618]: expected function, found `{integer}`
44-
--> $DIR/parse.rs:29:5
44+
--> $DIR/parse.rs:30:5
4545
|
4646
LL | 1.use(2);
4747
| ^^^^^---

0 commit comments

Comments
 (0)