Make feature flag incomplete
This commit is contained in:
parent
5a6d00c05d
commit
d7104dc3f5
29 changed files with 43 additions and 25 deletions
|
@ -474,7 +474,7 @@ declare_features! (
|
|||
/// Allows `dyn* Trait` objects.
|
||||
(incomplete, dyn_star, "1.65.0", Some(102425)),
|
||||
/// Allows the .use postfix syntax `x.use` and use closures `use |x| { ... }`
|
||||
(unstable, ergonomic_clones, "CURRENT_RUSTC_VERSION", Some(132290)),
|
||||
(incomplete, ergonomic_clones, "CURRENT_RUSTC_VERSION", Some(132290)),
|
||||
/// Allows exhaustive pattern matching on types that contain uninhabited types.
|
||||
(unstable, exhaustive_patterns, "1.13.0", Some(51085)),
|
||||
/// Allows explicit tail calls via `become` expression.
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
//@ edition:2018
|
||||
|
||||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::future::Future;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn main() {
|
||||
async use {};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: `async use` blocks are only allowed in Rust 2018 or later
|
||||
--> $DIR/edition-2015.rs:4:5
|
||||
--> $DIR/edition-2015.rs:5:5
|
||||
|
|
||||
LL | async use {};
|
||||
| ^^^^^^^^^
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
//@ edition:2018
|
||||
|
||||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn main() {
|
||||
let _ = async use |x: x| x; //~ ERROR expected type
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
error[E0573]: expected type, found local variable `x`
|
||||
--> $DIR/local-type.rs:7:27
|
||||
--> $DIR/local-type.rs:8:27
|
||||
|
|
||||
LL | let _ = async use |x: x| x;
|
||||
| ^ not a type
|
||||
|
||||
error[E0573]: expected type, found local variable `x`
|
||||
--> $DIR/local-type.rs:8:36
|
||||
--> $DIR/local-type.rs:9:36
|
||||
|
|
||||
LL | let _ = async use |x: bool| -> x { x };
|
||||
| ^ not a type
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
//@ check-pass
|
||||
|
||||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::clone::UseCloned;
|
||||
use std::future::Future;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn get_closure() -> Box<dyn Fn() -> Vec<u8>> {
|
||||
let vec = vec![1u8, 2u8];
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
|
||||
--> $DIR/fn-once.rs:6:19
|
||||
--> $DIR/fn-once.rs:7:19
|
||||
|
|
||||
LL | let closure = use || {
|
||||
| ^^^^^^ this closure implements `FnOnce`, not `Fn`
|
||||
|
@ -9,7 +9,7 @@ LL | vec
|
|||
LL | Box::new(closure)
|
||||
| ----------------- the requirement to implement `Fn` derives from here
|
||||
|
|
||||
= note: required for the cast from `Box<{closure@$DIR/fn-once.rs:6:19: 6:25}>` to `Box<(dyn Fn() -> Vec<u8> + 'static)>`
|
||||
= note: required for the cast from `Box<{closure@$DIR/fn-once.rs:7:19: 7:25}>` to `Box<(dyn Fn() -> Vec<u8> + 'static)>`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// Point at the captured immutable outer variable
|
||||
|
||||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn foo(mut f: Box<dyn FnMut()>) {
|
||||
f();
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// Point at the captured immutable outer variable
|
||||
|
||||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn foo(mut f: Box<dyn FnMut()>) {
|
||||
f();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0594]: cannot assign to `y`, as it is not declared as mutable
|
||||
--> $DIR/immutable-outer-variable.rs:13:25
|
||||
--> $DIR/immutable-outer-variable.rs:14:25
|
||||
|
|
||||
LL | foo(Box::new(use || y = !y) as Box<_>);
|
||||
| ^^^^^^ cannot assign
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Check that using the parameter name in its type does not ICE.
|
||||
|
||||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn main() {
|
||||
let _ = use |x: x| x; //~ ERROR expected type
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
error[E0573]: expected type, found local variable `x`
|
||||
--> $DIR/local-type.rs:6:21
|
||||
--> $DIR/local-type.rs:7:21
|
||||
|
|
||||
LL | let _ = use |x: x| x;
|
||||
| ^ not a type
|
||||
|
||||
error[E0573]: expected type, found local variable `x`
|
||||
--> $DIR/local-type.rs:7:30
|
||||
--> $DIR/local-type.rs:8:30
|
||||
|
|
||||
LL | let _ = use |x: bool| -> x { x };
|
||||
| ^ not a type
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
//@ check-pass
|
||||
|
||||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn main() {
|
||||
let mut my_var = false;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn main() {
|
||||
let mut my_var = false;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0596]: cannot borrow `callback` as mutable, as it is not declared as mutable
|
||||
--> $DIR/mutation2.rs:8:5
|
||||
--> $DIR/mutation2.rs:9:5
|
||||
|
|
||||
LL | my_var = true;
|
||||
| ------ calling `callback` requires mutable binding due to possible mutation of `my_var`
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
//@ run-pass
|
||||
|
||||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::clone::UseCloned;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Testing guarantees provided by once functions.
|
||||
|
||||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn parse1() {
|
||||
|| use {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: expected one of `async`, `|`, or `||`, found `{`
|
||||
--> $DIR/parse.rs:4:12
|
||||
--> $DIR/parse.rs:5:12
|
||||
|
|
||||
LL | || use {
|
||||
| -- ^ expected one of `async`, `|`, or `||`
|
||||
|
@ -13,13 +13,13 @@ LL ~ || { use {
|
|||
|
|
||||
|
||||
error: expected one of `async`, `|`, or `||`, found keyword `use`
|
||||
--> $DIR/parse.rs:10:10
|
||||
--> $DIR/parse.rs:11:10
|
||||
|
|
||||
LL | move use || {
|
||||
| ^^^ expected one of `async`, `|`, or `||`
|
||||
|
||||
error: expected one of `async`, `|`, or `||`, found keyword `move`
|
||||
--> $DIR/parse.rs:16:9
|
||||
--> $DIR/parse.rs:17:9
|
||||
|
|
||||
LL | use move || {
|
||||
| ^^^^ expected one of `async`, `|`, or `||`
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
//@ compile-flags: -Zverbose-internals
|
||||
|
||||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn to_fn_once<F: FnOnce()>(f: F) -> F {
|
||||
f
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error[E0382]: use of moved value: `c`
|
||||
--> $DIR/print-verbose.rs:21:5
|
||||
--> $DIR/print-verbose.rs:22:5
|
||||
|
|
||||
LL | let c = to_fn_once(use || {
|
||||
| - 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();
|
|||
| ^ value used here after move
|
||||
|
|
||||
note: this value implements `FnOnce`, which causes it to be moved when called
|
||||
--> $DIR/print-verbose.rs:20:5
|
||||
--> $DIR/print-verbose.rs:21:5
|
||||
|
|
||||
LL | c();
|
||||
| ^
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn to_fn_once<F: FnOnce()>(f: F) -> F {
|
||||
f
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
error[E0382]: use of moved value: `c`
|
||||
--> $DIR/print.rs:19:5
|
||||
--> $DIR/print.rs:20:5
|
||||
|
|
||||
LL | let c = to_fn_once(use || {
|
||||
| - move occurs because `c` has type `{closure@$DIR/print.rs:14:24: 14:30}`, which does not implement the `Copy` trait
|
||||
| - move occurs because `c` has type `{closure@$DIR/print.rs:15:24: 15:30}`, which does not implement the `Copy` trait
|
||||
...
|
||||
LL | c();
|
||||
| --- `c` moved due to this call
|
||||
|
@ -10,7 +10,7 @@ LL | c();
|
|||
| ^ value used here after move
|
||||
|
|
||||
note: this value implements `FnOnce`, which causes it to be moved when called
|
||||
--> $DIR/print.rs:18:5
|
||||
--> $DIR/print.rs:19:5
|
||||
|
|
||||
LL | c();
|
||||
| ^
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#![feature(closure_lifetime_binder)]
|
||||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn main() {
|
||||
for<'a> use || -> () {};
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
//@ check-pass
|
||||
|
||||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::clone::UseCloned;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![feature(ergonomic_clones)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn parse1() {
|
||||
1.use!;
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `!`
|
||||
--> $DIR/parse.rs:4:10
|
||||
--> $DIR/parse.rs:5:10
|
||||
|
|
||||
LL | 1.use!;
|
||||
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
|
||||
|
||||
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `!`
|
||||
--> $DIR/parse.rs:9:10
|
||||
--> $DIR/parse.rs:10:10
|
||||
|
|
||||
LL | 1.use!(2);
|
||||
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
|
||||
|
||||
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `2`
|
||||
--> $DIR/parse.rs:14:11
|
||||
--> $DIR/parse.rs:15:11
|
||||
|
|
||||
LL | 1.use 2;
|
||||
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
|
||||
|
||||
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `2`
|
||||
--> $DIR/parse.rs:19:12
|
||||
--> $DIR/parse.rs:20:12
|
||||
|
|
||||
LL | 1.use? 2;
|
||||
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
|
||||
|
||||
error: incorrect use of `use`
|
||||
--> $DIR/parse.rs:24:10
|
||||
--> $DIR/parse.rs:25:10
|
||||
|
|
||||
LL | 1.use();
|
||||
| ^^
|
||||
|
@ -35,13 +35,13 @@ LL + 1.use;
|
|||
|
|
||||
|
||||
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
|
||||
--> $DIR/parse.rs:34:11
|
||||
--> $DIR/parse.rs:35:11
|
||||
|
|
||||
LL | 1.use { 2 };
|
||||
| ^ expected one of `.`, `;`, `?`, `}`, or an operator
|
||||
|
||||
error[E0618]: expected function, found `{integer}`
|
||||
--> $DIR/parse.rs:29:5
|
||||
--> $DIR/parse.rs:30:5
|
||||
|
|
||||
LL | 1.use(2);
|
||||
| ^^^^^---
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue