Rollup merge of #117127 - compiler-errors:incomplete, r=lqd

Remove `#[allow(incomplete_features)]` from RPITIT/AFIT tests

They've been unnecessary for a while.
This commit is contained in:
Matthias Krüger 2023-10-24 19:29:56 +02:00 committed by GitHub
commit 060bdfd9f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
39 changed files with 29 additions and 74 deletions

View File

@ -1,7 +1,5 @@
// edition: 2021 // edition: 2021
#![allow(incomplete_features)]
use std::future::Future; use std::future::Future;
use std::pin::Pin; use std::pin::Pin;

View File

@ -1,11 +1,11 @@
error[E0053]: method `foo` has an incompatible type for trait error[E0053]: method `foo` has an incompatible type for trait
--> $DIR/async-example-desugared-boxed-in-trait.rs:13:5 --> $DIR/async-example-desugared-boxed-in-trait.rs:11:5
| |
LL | async fn foo(&self) -> i32 { LL | async fn foo(&self) -> i32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = i32>>>`, found future | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = i32>>>`, found future
| |
note: type in trait note: type in trait
--> $DIR/async-example-desugared-boxed-in-trait.rs:9:22 --> $DIR/async-example-desugared-boxed-in-trait.rs:7:22
| |
LL | fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>>; LL | fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,7 +1,5 @@
// edition: 2021 // edition: 2021
#![allow(incomplete_features)]
use std::future::Future; use std::future::Future;
use std::pin::Pin; use std::pin::Pin;

View File

@ -1,5 +1,5 @@
error: method `foo` should be async because the method from the trait is async error: method `foo` should be async because the method from the trait is async
--> $DIR/async-example-desugared-boxed.rs:13:5 --> $DIR/async-example-desugared-boxed.rs:11:5
| |
LL | async fn foo(&self) -> i32; LL | async fn foo(&self) -> i32;
| --------------------------- required because the trait method is async | --------------------------- required because the trait method is async

View File

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

View File

@ -1,8 +1,6 @@
// check-pass // check-pass
// edition: 2021 // edition: 2021
#![allow(incomplete_features)]
use std::future::Future; use std::future::Future;
trait MyTrait { trait MyTrait {

View File

@ -1,7 +1,5 @@
// edition: 2021 // edition: 2021
#![allow(incomplete_features)]
use std::future::Future; use std::future::Future;
use std::task::Poll; use std::task::Poll;

View File

@ -1,5 +1,5 @@
error: method `foo` should be async because the method from the trait is async error: method `foo` should be async because the method from the trait is async
--> $DIR/async-example-desugared-manual.rs:21:5 --> $DIR/async-example-desugared-manual.rs:19:5
| |
LL | async fn foo(&self) -> i32; LL | async fn foo(&self) -> i32;
| --------------------------- required because the trait method is async | --------------------------- required because the trait method is async

View File

@ -1,8 +1,6 @@
// check-pass // check-pass
// edition: 2021 // edition: 2021
#![allow(incomplete_features)]
use std::future::Future; use std::future::Future;
trait MyTrait { trait MyTrait {

View File

@ -1,8 +1,6 @@
// check-pass // check-pass
// edition: 2021 // edition: 2021
#![allow(incomplete_features)]
trait MyTrait { trait MyTrait {
#[allow(async_fn_in_trait)] #[allow(async_fn_in_trait)]
async fn foo(&self) -> i32; async fn foo(&self) -> i32;

View File

@ -2,8 +2,6 @@
// known-bug: #102682 // known-bug: #102682
// edition: 2021 // edition: 2021
#![allow(incomplete_features)]
use std::fmt::Debug; use std::fmt::Debug;
use std::hash::Hash; use std::hash::Hash;

View File

@ -1,5 +1,5 @@
error[E0311]: the parameter type `U` may not live long enough error[E0311]: the parameter type `U` may not live long enough
--> $DIR/async-generics-and-bounds.rs:11:5 --> $DIR/async-generics-and-bounds.rs:9:5
| |
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -13,7 +13,7 @@ LL | async fn foo<'a>(&'a self) -> &'a (T, U) where T: Debug + Sized, U: Has
| ++++ ++ ++ +++++++ | ++++ ++ ++ +++++++
error[E0311]: the parameter type `T` may not live long enough error[E0311]: the parameter type `T` may not live long enough
--> $DIR/async-generics-and-bounds.rs:11:5 --> $DIR/async-generics-and-bounds.rs:9:5
| |
LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash; LL | async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -2,8 +2,6 @@
// known-bug: #102682 // known-bug: #102682
// edition: 2021 // edition: 2021
#![allow(incomplete_features)]
trait MyTrait<T, U> { trait MyTrait<T, U> {
async fn foo(&self) -> &(T, U); async fn foo(&self) -> &(T, U);
} }

View File

@ -1,5 +1,5 @@
error[E0311]: the parameter type `U` may not live long enough error[E0311]: the parameter type `U` may not live long enough
--> $DIR/async-generics.rs:8:5 --> $DIR/async-generics.rs:6:5
| |
LL | async fn foo(&self) -> &(T, U); LL | async fn foo(&self) -> &(T, U);
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^
@ -13,7 +13,7 @@ LL | async fn foo<'a>(&'a self) -> &'a (T, U) where U: 'a;
| ++++ ++ ++ +++++++++++ | ++++ ++ ++ +++++++++++
error[E0311]: the parameter type `T` may not live long enough error[E0311]: the parameter type `T` may not live long enough
--> $DIR/async-generics.rs:8:5 --> $DIR/async-generics.rs:6:5
| |
LL | async fn foo(&self) -> &(T, U); LL | async fn foo(&self) -> &(T, U);
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^

View File

@ -1,8 +1,6 @@
// check-pass // check-pass
// edition: 2021 // edition: 2021
#![allow(incomplete_features)]
use std::fmt::Debug; use std::fmt::Debug;
trait MyTrait<'a, 'b, T> { trait MyTrait<'a, 'b, T> {

View File

@ -1,8 +1,6 @@
// check-pass // check-pass
// edition: 2021 // edition: 2021
#![allow(incomplete_features)]
trait MyTrait<'a, 'b, T> { trait MyTrait<'a, 'b, T> {
#[allow(async_fn_in_trait)] #[allow(async_fn_in_trait)]
async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T); async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T);

View File

@ -1,7 +1,5 @@
// edition: 2021 // edition: 2021
#![allow(incomplete_features)]
trait MyTrait<T> { trait MyTrait<T> {
async fn foo_recursive(&self, n: usize) -> T; async fn foo_recursive(&self, n: usize) -> T;
} }

View File

@ -1,5 +1,5 @@
error[E0733]: recursion in an `async fn` requires boxing error[E0733]: recursion in an `async fn` requires boxing
--> $DIR/async-recursive-generic.rs:10:5 --> $DIR/async-recursive-generic.rs:8:5
| |
LL | async fn foo_recursive(&self, n: usize) -> T { LL | async fn foo_recursive(&self, n: usize) -> T {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive `async fn` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive `async fn`

View File

@ -1,7 +1,5 @@
// edition: 2021 // edition: 2021
#![allow(incomplete_features)]
trait MyTrait { trait MyTrait {
async fn foo_recursive(&self, n: usize) -> i32; async fn foo_recursive(&self, n: usize) -> i32;
} }

View File

@ -1,5 +1,5 @@
error[E0733]: recursion in an `async fn` requires boxing error[E0733]: recursion in an `async fn` requires boxing
--> $DIR/async-recursive.rs:10:5 --> $DIR/async-recursive.rs:8:5
| |
LL | async fn foo_recursive(&self, n: usize) -> i32 { LL | async fn foo_recursive(&self, n: usize) -> i32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive `async fn` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive `async fn`

View File

@ -1,8 +1,6 @@
// check-pass // check-pass
// edition:2021 // edition:2021
#![allow(incomplete_features)]
pub trait Foo { pub trait Foo {
#[allow(async_fn_in_trait)] #[allow(async_fn_in_trait)]
async fn foo(&mut self); async fn foo(&mut self);

View File

@ -1,5 +1,3 @@
#![allow(incomplete_features)]
struct Wrapper<T>(T); struct Wrapper<T>(T);
trait Foo { trait Foo {

View File

@ -1,5 +1,5 @@
error[E0053]: method `bar` has an incompatible return type for trait error[E0053]: method `bar` has an incompatible return type for trait
--> $DIR/deep-match.rs:10:17 --> $DIR/deep-match.rs:8:17
| |
LL | fn bar() -> i32 { LL | fn bar() -> i32 {
| ^^^ | ^^^

View File

@ -1,5 +1,3 @@
#![allow(incomplete_features)]
use std::ops::Deref; use std::ops::Deref;
pub trait Foo { pub trait Foo {

View File

@ -1,5 +1,5 @@
error[E0271]: type mismatch resolving `<&i32 as Deref>::Target == String` error[E0271]: type mismatch resolving `<&i32 as Deref>::Target == String`
--> $DIR/default-body-type-err.rs:6:22 --> $DIR/default-body-type-err.rs:4:22
| |
LL | fn lol(&self) -> impl Deref<Target = String> { LL | fn lol(&self) -> impl Deref<Target = String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`

View File

@ -1,5 +1,3 @@
#![allow(incomplete_features)]
trait Foo { trait Foo {
fn bar() -> impl std::fmt::Display; fn bar() -> impl std::fmt::Display;
} }

View File

@ -1,5 +1,5 @@
error[E0277]: `()` doesn't implement `std::fmt::Display` error[E0277]: `()` doesn't implement `std::fmt::Display`
--> $DIR/doesnt-satisfy.rs:8:17 --> $DIR/doesnt-satisfy.rs:6:17
| |
LL | fn bar() -> () {} LL | fn bar() -> () {}
| ^^ `()` cannot be formatted with the default formatter | ^^ `()` cannot be formatted with the default formatter
@ -7,7 +7,7 @@ LL | fn bar() -> () {}
= help: the trait `std::fmt::Display` is not implemented for `()` = help: the trait `std::fmt::Display` is not implemented for `()`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
note: required by a bound in `Foo::{opaque#0}` note: required by a bound in `Foo::{opaque#0}`
--> $DIR/doesnt-satisfy.rs:4:22 --> $DIR/doesnt-satisfy.rs:2:22
| |
LL | fn bar() -> impl std::fmt::Display; LL | fn bar() -> impl std::fmt::Display;
| ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::{opaque#0}` | ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::{opaque#0}`

View File

@ -1,5 +1,3 @@
#![allow(incomplete_features)]
struct U; struct U;
trait Foo { trait Foo {

View File

@ -1,5 +1,5 @@
error[E0049]: method `bar` has 1 type parameter but its trait declaration has 0 type parameters error[E0049]: method `bar` has 1 type parameter but its trait declaration has 0 type parameters
--> $DIR/generics-mismatch.rs:10:12 --> $DIR/generics-mismatch.rs:8:12
| |
LL | fn bar(&self) -> impl Sized; LL | fn bar(&self) -> impl Sized;
| - expected 0 type parameters | - expected 0 type parameters

View File

@ -1,5 +1,3 @@
#![allow(incomplete_features)]
trait Marker {} trait Marker {}
impl Marker for u32 {} impl Marker for u32 {}

View File

@ -1,5 +1,5 @@
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
--> $DIR/issue-102140.rs:22:22 --> $DIR/issue-102140.rs:20:22
| |
LL | MyTrait::foo(&self) LL | MyTrait::foo(&self)
| ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait` | ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
@ -13,7 +13,7 @@ LL + MyTrait::foo(self)
| |
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
--> $DIR/issue-102140.rs:22:9 --> $DIR/issue-102140.rs:20:9
| |
LL | MyTrait::foo(&self) LL | MyTrait::foo(&self)
| ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait` | ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
@ -21,7 +21,7 @@ LL | MyTrait::foo(&self)
= help: the trait `MyTrait` is implemented for `Outer` = help: the trait `MyTrait` is implemented for `Outer`
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
--> $DIR/issue-102140.rs:22:9 --> $DIR/issue-102140.rs:20:9
| |
LL | MyTrait::foo(&self) LL | MyTrait::foo(&self)
| ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait` | ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`

View File

@ -1,5 +1,3 @@
#![allow(incomplete_features)]
use std::fmt::Display; use std::fmt::Display;
use std::ops::Deref; use std::ops::Deref;

View File

@ -1,5 +1,5 @@
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-102571.rs:11:9 --> $DIR/issue-102571.rs:9:9
| |
LL | let () = t.bar(); LL | let () = t.bar();
| ^^ ------- this expression has type `impl Deref<Target = impl std::fmt::Display + ?Sized>` | ^^ ------- this expression has type `impl Deref<Target = impl std::fmt::Display + ?Sized>`

View File

@ -1,5 +1,3 @@
#![allow(incomplete_features)]
use std::fmt::Debug; use std::fmt::Debug;
trait Foo { trait Foo {

View File

@ -1,11 +1,11 @@
error[E0038]: the trait `Foo` cannot be made into an object error[E0038]: the trait `Foo` cannot be made into an object
--> $DIR/object-safety.rs:16:33 --> $DIR/object-safety.rs:14:33
| |
LL | let i = Box::new(42_u32) as Box<dyn Foo>; LL | let i = Box::new(42_u32) as Box<dyn Foo>;
| ^^^^^^^^^^^^ `Foo` cannot be made into an object | ^^^^^^^^^^^^ `Foo` cannot be made into an object
| |
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
--> $DIR/object-safety.rs:6:22 --> $DIR/object-safety.rs:4:22
| |
LL | trait Foo { LL | trait Foo {
| --- this trait cannot be made into an object... | --- this trait cannot be made into an object...
@ -14,13 +14,13 @@ LL | fn baz(&self) -> impl Debug;
= help: consider moving `baz` to another trait = help: consider moving `baz` to another trait
error[E0038]: the trait `Foo` cannot be made into an object error[E0038]: the trait `Foo` cannot be made into an object
--> $DIR/object-safety.rs:19:15 --> $DIR/object-safety.rs:17:15
| |
LL | let s = i.baz(); LL | let s = i.baz();
| ^^^ `Foo` cannot be made into an object | ^^^ `Foo` cannot be made into an object
| |
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
--> $DIR/object-safety.rs:6:22 --> $DIR/object-safety.rs:4:22
| |
LL | trait Foo { LL | trait Foo {
| --- this trait cannot be made into an object... | --- this trait cannot be made into an object...
@ -29,13 +29,13 @@ LL | fn baz(&self) -> impl Debug;
= help: consider moving `baz` to another trait = help: consider moving `baz` to another trait
error[E0038]: the trait `Foo` cannot be made into an object error[E0038]: the trait `Foo` cannot be made into an object
--> $DIR/object-safety.rs:19:13 --> $DIR/object-safety.rs:17:13
| |
LL | let s = i.baz(); LL | let s = i.baz();
| ^^^^^^^ `Foo` cannot be made into an object | ^^^^^^^ `Foo` cannot be made into an object
| |
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
--> $DIR/object-safety.rs:6:22 --> $DIR/object-safety.rs:4:22
| |
LL | trait Foo { LL | trait Foo {
| --- this trait cannot be made into an object... | --- this trait cannot be made into an object...
@ -44,13 +44,13 @@ LL | fn baz(&self) -> impl Debug;
= help: consider moving `baz` to another trait = help: consider moving `baz` to another trait
error[E0038]: the trait `Foo` cannot be made into an object error[E0038]: the trait `Foo` cannot be made into an object
--> $DIR/object-safety.rs:16:13 --> $DIR/object-safety.rs:14:13
| |
LL | let i = Box::new(42_u32) as Box<dyn Foo>; LL | let i = Box::new(42_u32) as Box<dyn Foo>;
| ^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object | ^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
| |
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
--> $DIR/object-safety.rs:6:22 --> $DIR/object-safety.rs:4:22
| |
LL | trait Foo { LL | trait Foo {
| --- this trait cannot be made into an object... | --- this trait cannot be made into an object...

View File

@ -1,5 +1,3 @@
#![allow(incomplete_features)]
use std::fmt::Display; use std::fmt::Display;
trait Foo { trait Foo {

View File

@ -1,5 +1,5 @@
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/opaque-in-impl-is-opaque.rs:16:19 --> $DIR/opaque-in-impl-is-opaque.rs:14:19
| |
LL | fn bar(&self) -> impl Display { LL | fn bar(&self) -> impl Display {
| ------------ the found opaque type | ------------ the found opaque type

View File

@ -1,5 +1,3 @@
#![allow(incomplete_features)]
struct S; struct S;
trait Foo { trait Foo {

View File

@ -1,5 +1,5 @@
error[E0049]: method `bar` has 0 type parameters but its trait declaration has 1 type parameter error[E0049]: method `bar` has 0 type parameters but its trait declaration has 1 type parameter
--> $DIR/trait-more-generics-than-impl.rs:10:11 --> $DIR/trait-more-generics-than-impl.rs:8:11
| |
LL | fn bar<T>() -> impl Sized; LL | fn bar<T>() -> impl Sized;
| - expected 1 type parameter | - expected 1 type parameter