Make feature flag incomplete

This commit is contained in:
Santiago Pastorino 2025-03-06 18:06:48 -03:00
parent 5a6d00c05d
commit d7104dc3f5
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
29 changed files with 43 additions and 25 deletions

View file

@ -474,7 +474,7 @@ declare_features! (
/// Allows `dyn* Trait` objects. /// Allows `dyn* Trait` objects.
(incomplete, dyn_star, "1.65.0", Some(102425)), (incomplete, dyn_star, "1.65.0", Some(102425)),
/// Allows the .use postfix syntax `x.use` and use closures `use |x| { ... }` /// 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. /// Allows exhaustive pattern matching on types that contain uninhabited types.
(unstable, exhaustive_patterns, "1.13.0", Some(51085)), (unstable, exhaustive_patterns, "1.13.0", Some(51085)),
/// Allows explicit tail calls via `become` expression. /// Allows explicit tail calls via `become` expression.

View file

@ -2,6 +2,7 @@
//@ edition:2018 //@ edition:2018
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
use std::future::Future; use std::future::Future;

View file

@ -1,4 +1,5 @@
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn main() { fn main() {
async use {}; async use {};

View file

@ -1,5 +1,5 @@
error: `async use` blocks are only allowed in Rust 2018 or later 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 {}; LL | async use {};
| ^^^^^^^^^ | ^^^^^^^^^

View file

@ -2,6 +2,7 @@
//@ edition:2018 //@ edition:2018
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn main() { fn main() {
let _ = async use |x: x| x; //~ ERROR expected type let _ = async use |x: x| x; //~ ERROR expected type

View file

@ -1,11 +1,11 @@
error[E0573]: expected type, found local variable `x` 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; LL | let _ = async use |x: x| x;
| ^ not a type | ^ not a type
error[E0573]: expected type, found local variable `x` 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 }; LL | let _ = async use |x: bool| -> x { x };
| ^ not a type | ^ not a type

View file

@ -1,6 +1,7 @@
//@ check-pass //@ check-pass
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
use std::clone::UseCloned; use std::clone::UseCloned;
use std::future::Future; use std::future::Future;

View file

@ -1,4 +1,5 @@
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn get_closure() -> Box<dyn Fn() -> Vec<u8>> { fn get_closure() -> Box<dyn Fn() -> Vec<u8>> {
let vec = vec![1u8, 2u8]; let vec = vec![1u8, 2u8];

View file

@ -1,5 +1,5 @@
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce` 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 || { LL | let closure = use || {
| ^^^^^^ this closure implements `FnOnce`, not `Fn` | ^^^^^^ this closure implements `FnOnce`, not `Fn`
@ -9,7 +9,7 @@ LL | vec
LL | Box::new(closure) LL | Box::new(closure)
| ----------------- the requirement to implement `Fn` derives from here | ----------------- 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 error: aborting due to 1 previous error

View file

@ -3,6 +3,7 @@
// Point at the captured immutable outer variable // Point at the captured immutable outer variable
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn foo(mut f: Box<dyn FnMut()>) { fn foo(mut f: Box<dyn FnMut()>) {
f(); f();

View file

@ -3,6 +3,7 @@
// Point at the captured immutable outer variable // Point at the captured immutable outer variable
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn foo(mut f: Box<dyn FnMut()>) { fn foo(mut f: Box<dyn FnMut()>) {
f(); f();

View file

@ -1,5 +1,5 @@
error[E0594]: cannot assign to `y`, as it is not declared as mutable 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<_>); LL | foo(Box::new(use || y = !y) as Box<_>);
| ^^^^^^ cannot assign | ^^^^^^ cannot assign

View file

@ -1,6 +1,7 @@
// Check that using the parameter name in its type does not ICE. // Check that using the parameter name in its type does not ICE.
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn main() { fn main() {
let _ = use |x: x| x; //~ ERROR expected type let _ = use |x: x| x; //~ ERROR expected type

View file

@ -1,11 +1,11 @@
error[E0573]: expected type, found local variable `x` 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; LL | let _ = use |x: x| x;
| ^ not a type | ^ not a type
error[E0573]: expected type, found local variable `x` 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 }; LL | let _ = use |x: bool| -> x { x };
| ^ not a type | ^ not a type

View file

@ -1,6 +1,7 @@
//@ check-pass //@ check-pass
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn main() { fn main() {
let mut my_var = false; let mut my_var = false;

View file

@ -1,4 +1,5 @@
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn main() { fn main() {
let mut my_var = false; let mut my_var = false;

View file

@ -1,5 +1,5 @@
error[E0596]: cannot borrow `callback` as mutable, as it is not declared as mutable 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; LL | my_var = true;
| ------ calling `callback` requires mutable binding due to possible mutation of `my_var` | ------ calling `callback` requires mutable binding due to possible mutation of `my_var`

View file

@ -1,6 +1,7 @@
//@ run-pass //@ run-pass
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
use std::clone::UseCloned; use std::clone::UseCloned;

View file

@ -2,6 +2,7 @@
// Testing guarantees provided by once functions. // Testing guarantees provided by once functions.
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
use std::sync::Arc; use std::sync::Arc;

View file

@ -1,4 +1,5 @@
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn parse1() { fn parse1() {
|| use { || use {

View file

@ -1,5 +1,5 @@
error: expected one of `async`, `|`, or `||`, found `{` error: expected one of `async`, `|`, or `||`, found `{`
--> $DIR/parse.rs:4:12 --> $DIR/parse.rs:5:12
| |
LL | || use { LL | || use {
| -- ^ expected one of `async`, `|`, or `||` | -- ^ expected one of `async`, `|`, or `||`
@ -13,13 +13,13 @@ LL ~ || { use {
| |
error: expected one of `async`, `|`, or `||`, found keyword `use` error: expected one of `async`, `|`, or `||`, found keyword `use`
--> $DIR/parse.rs:10:10 --> $DIR/parse.rs:11:10
| |
LL | move use || { LL | move use || {
| ^^^ expected one of `async`, `|`, or `||` | ^^^ expected one of `async`, `|`, or `||`
error: expected one of `async`, `|`, or `||`, found keyword `move` error: expected one of `async`, `|`, or `||`, found keyword `move`
--> $DIR/parse.rs:16:9 --> $DIR/parse.rs:17:9
| |
LL | use move || { LL | use move || {
| ^^^^ expected one of `async`, `|`, or `||` | ^^^^ expected one of `async`, `|`, or `||`

View file

@ -1,6 +1,7 @@
//@ compile-flags: -Zverbose-internals //@ compile-flags: -Zverbose-internals
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn to_fn_once<F: FnOnce()>(f: F) -> F { fn to_fn_once<F: FnOnce()>(f: F) -> F {
f f

View file

@ -1,5 +1,5 @@
error[E0382]: use of moved value: `c` 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 || { 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 | - 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 | ^ value used here after move
| |
note: this value implements `FnOnce`, which causes it to be moved when called 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(); LL | c();
| ^ | ^

View file

@ -1,4 +1,5 @@
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn to_fn_once<F: FnOnce()>(f: F) -> F { fn to_fn_once<F: FnOnce()>(f: F) -> F {
f f

View file

@ -1,8 +1,8 @@
error[E0382]: use of moved value: `c` error[E0382]: use of moved value: `c`
--> $DIR/print.rs:19:5 --> $DIR/print.rs:20:5
| |
LL | let c = to_fn_once(use || { 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(); LL | c();
| --- `c` moved due to this call | --- `c` moved due to this call
@ -10,7 +10,7 @@ LL | c();
| ^ value used here after move | ^ value used here after move
| |
note: this value implements `FnOnce`, which causes it to be moved when called 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(); LL | c();
| ^ | ^

View file

@ -3,6 +3,7 @@
#![feature(closure_lifetime_binder)] #![feature(closure_lifetime_binder)]
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn main() { fn main() {
for<'a> use || -> () {}; for<'a> use || -> () {};

View file

@ -1,6 +1,7 @@
//@ check-pass //@ check-pass
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
use std::clone::UseCloned; use std::clone::UseCloned;

View file

@ -1,4 +1,5 @@
#![feature(ergonomic_clones)] #![feature(ergonomic_clones)]
#![allow(incomplete_features)]
fn parse1() { fn parse1() {
1.use!; 1.use!;

View file

@ -1,29 +1,29 @@
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `!` error: expected one of `.`, `;`, `?`, `}`, or an operator, found `!`
--> $DIR/parse.rs:4:10 --> $DIR/parse.rs:5:10
| |
LL | 1.use!; LL | 1.use!;
| ^ expected one of `.`, `;`, `?`, `}`, or an operator | ^ expected one of `.`, `;`, `?`, `}`, or an operator
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `!` error: expected one of `.`, `;`, `?`, `}`, or an operator, found `!`
--> $DIR/parse.rs:9:10 --> $DIR/parse.rs:10:10
| |
LL | 1.use!(2); LL | 1.use!(2);
| ^ expected one of `.`, `;`, `?`, `}`, or an operator | ^ expected one of `.`, `;`, `?`, `}`, or an operator
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `2` error: expected one of `.`, `;`, `?`, `}`, or an operator, found `2`
--> $DIR/parse.rs:14:11 --> $DIR/parse.rs:15:11
| |
LL | 1.use 2; LL | 1.use 2;
| ^ expected one of `.`, `;`, `?`, `}`, or an operator | ^ expected one of `.`, `;`, `?`, `}`, or an operator
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `2` error: expected one of `.`, `;`, `?`, `}`, or an operator, found `2`
--> $DIR/parse.rs:19:12 --> $DIR/parse.rs:20:12
| |
LL | 1.use? 2; LL | 1.use? 2;
| ^ expected one of `.`, `;`, `?`, `}`, or an operator | ^ expected one of `.`, `;`, `?`, `}`, or an operator
error: incorrect use of `use` error: incorrect use of `use`
--> $DIR/parse.rs:24:10 --> $DIR/parse.rs:25:10
| |
LL | 1.use(); LL | 1.use();
| ^^ | ^^
@ -35,13 +35,13 @@ LL + 1.use;
| |
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{` error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
--> $DIR/parse.rs:34:11 --> $DIR/parse.rs:35:11
| |
LL | 1.use { 2 }; LL | 1.use { 2 };
| ^ expected one of `.`, `;`, `?`, `}`, or an operator | ^ expected one of `.`, `;`, `?`, `}`, or an operator
error[E0618]: expected function, found `{integer}` error[E0618]: expected function, found `{integer}`
--> $DIR/parse.rs:29:5 --> $DIR/parse.rs:30:5
| |
LL | 1.use(2); LL | 1.use(2);
| ^^^^^--- | ^^^^^---