mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
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:
commit
060bdfd9f3
@ -1,7 +1,5 @@
|
||||
// edition: 2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
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 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = i32>>>`, found future
|
||||
|
|
||||
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> + '_>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -1,7 +1,5 @@
|
||||
// edition: 2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
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;
|
||||
| --------------------------- required because the trait method is async
|
||||
|
@ -2,7 +2,6 @@
|
||||
// edition: 2021
|
||||
|
||||
#![feature(lint_reasons)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
|
@ -1,8 +1,6 @@
|
||||
// check-pass
|
||||
// edition: 2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::future::Future;
|
||||
|
||||
trait MyTrait {
|
||||
|
@ -1,7 +1,5 @@
|
||||
// edition: 2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::future::Future;
|
||||
use std::task::Poll;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
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;
|
||||
| --------------------------- required because the trait method is async
|
||||
|
@ -1,8 +1,6 @@
|
||||
// check-pass
|
||||
// edition: 2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::future::Future;
|
||||
|
||||
trait MyTrait {
|
||||
|
@ -1,8 +1,6 @@
|
||||
// check-pass
|
||||
// edition: 2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait MyTrait {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo(&self) -> i32;
|
||||
|
@ -2,8 +2,6 @@
|
||||
// known-bug: #102682
|
||||
// edition: 2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
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;
|
||||
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@ -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
|
||||
--> $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;
|
||||
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -2,8 +2,6 @@
|
||||
// known-bug: #102682
|
||||
// edition: 2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait MyTrait<T, U> {
|
||||
async fn foo(&self) -> &(T, U);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
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);
|
||||
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^
|
||||
@ -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
|
||||
--> $DIR/async-generics.rs:8:5
|
||||
--> $DIR/async-generics.rs:6:5
|
||||
|
|
||||
LL | async fn foo(&self) -> &(T, U);
|
||||
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^
|
||||
|
@ -1,8 +1,6 @@
|
||||
// check-pass
|
||||
// edition: 2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
trait MyTrait<'a, 'b, T> {
|
||||
|
@ -1,8 +1,6 @@
|
||||
// check-pass
|
||||
// edition: 2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait MyTrait<'a, 'b, T> {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T);
|
||||
|
@ -1,7 +1,5 @@
|
||||
// edition: 2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait MyTrait<T> {
|
||||
async fn foo_recursive(&self, n: usize) -> T;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
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 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive `async fn`
|
||||
|
@ -1,7 +1,5 @@
|
||||
// edition: 2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait MyTrait {
|
||||
async fn foo_recursive(&self, n: usize) -> i32;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
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 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive `async fn`
|
||||
|
@ -1,8 +1,6 @@
|
||||
// check-pass
|
||||
// edition:2021
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
pub trait Foo {
|
||||
#[allow(async_fn_in_trait)]
|
||||
async fn foo(&mut self);
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
struct Wrapper<T>(T);
|
||||
|
||||
trait Foo {
|
||||
|
@ -1,5 +1,5 @@
|
||||
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 {
|
||||
| ^^^
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::ops::Deref;
|
||||
|
||||
pub trait Foo {
|
||||
|
@ -1,5 +1,5 @@
|
||||
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> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait Foo {
|
||||
fn bar() -> impl std::fmt::Display;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0277]: `()` doesn't implement `std::fmt::Display`
|
||||
--> $DIR/doesnt-satisfy.rs:8:17
|
||||
--> $DIR/doesnt-satisfy.rs:6:17
|
||||
|
|
||||
LL | fn bar() -> () {}
|
||||
| ^^ `()` cannot be formatted with the default formatter
|
||||
@ -7,7 +7,7 @@ LL | fn bar() -> () {}
|
||||
= 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: 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;
|
||||
| ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::{opaque#0}`
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
struct U;
|
||||
|
||||
trait Foo {
|
||||
|
@ -1,5 +1,5 @@
|
||||
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;
|
||||
| - expected 0 type parameters
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait Marker {}
|
||||
impl Marker for u32 {}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
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)
|
||||
| ------------ ^^^^^ 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
|
||||
--> $DIR/issue-102140.rs:22:9
|
||||
--> $DIR/issue-102140.rs:20:9
|
||||
|
|
||||
LL | MyTrait::foo(&self)
|
||||
| ^^^^^^^^^^^^^^^^^^^ 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`
|
||||
|
||||
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)
|
||||
| ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::fmt::Display;
|
||||
use std::ops::Deref;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-102571.rs:11:9
|
||||
--> $DIR/issue-102571.rs:9:9
|
||||
|
|
||||
LL | let () = t.bar();
|
||||
| ^^ ------- this expression has type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
trait Foo {
|
||||
|
@ -1,11 +1,11 @@
|
||||
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>;
|
||||
| ^^^^^^^^^^^^ `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>
|
||||
--> $DIR/object-safety.rs:6:22
|
||||
--> $DIR/object-safety.rs:4:22
|
||||
|
|
||||
LL | trait Foo {
|
||||
| --- 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
|
||||
|
||||
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();
|
||||
| ^^^ `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>
|
||||
--> $DIR/object-safety.rs:6:22
|
||||
--> $DIR/object-safety.rs:4:22
|
||||
|
|
||||
LL | trait Foo {
|
||||
| --- 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
|
||||
|
||||
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();
|
||||
| ^^^^^^^ `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>
|
||||
--> $DIR/object-safety.rs:6:22
|
||||
--> $DIR/object-safety.rs:4:22
|
||||
|
|
||||
LL | trait Foo {
|
||||
| --- 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
|
||||
|
||||
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>;
|
||||
| ^^^^^^^^^^^^^^^^ `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>
|
||||
--> $DIR/object-safety.rs:6:22
|
||||
--> $DIR/object-safety.rs:4:22
|
||||
|
|
||||
LL | trait Foo {
|
||||
| --- this trait cannot be made into an object...
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
use std::fmt::Display;
|
||||
|
||||
trait Foo {
|
||||
|
@ -1,5 +1,5 @@
|
||||
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 {
|
||||
| ------------ the found opaque type
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
struct S;
|
||||
|
||||
trait Foo {
|
||||
|
@ -1,5 +1,5 @@
|
||||
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;
|
||||
| - expected 1 type parameter
|
||||
|
Loading…
Reference in New Issue
Block a user