Skip to content

Commit

Permalink
Unrolled build for rust-lang#117127
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#117127 - compiler-errors:incomplete, r=lqd

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

They've been unnecessary for a while.
  • Loading branch information
rust-timer committed Oct 24, 2023
2 parents 98b4a64 + 90e3aae commit 4723ca3
Show file tree
Hide file tree
Showing 39 changed files with 29 additions and 74 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// edition: 2021

#![allow(incomplete_features)]

use std::future::Future;
use std::pin::Pin;

Expand Down
Original file line number Diff line number Diff line change
@@ -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> + '_>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// edition: 2021

#![allow(incomplete_features)]

use std::future::Future;
use std::pin::Pin;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// edition: 2021

#![feature(lint_reasons)]
#![allow(incomplete_features)]

use std::future::Future;
use std::pin::Pin;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// check-pass
// edition: 2021

#![allow(incomplete_features)]

use std::future::Future;

trait MyTrait {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// edition: 2021

#![allow(incomplete_features)]

use std::future::Future;
use std::task::Poll;

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/async-await/in-trait/async-example-desugared.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// check-pass
// edition: 2021

#![allow(incomplete_features)]

use std::future::Future;

trait MyTrait {
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/async-await/in-trait/async-example.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// check-pass
// edition: 2021

#![allow(incomplete_features)]

trait MyTrait {
#[allow(async_fn_in_trait)]
async fn foo(&self) -> i32;
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/async-await/in-trait/async-generics-and-bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// known-bug: #102682
// edition: 2021

#![allow(incomplete_features)]

use std::fmt::Debug;
use std::hash::Hash;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -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;
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/async-await/in-trait/async-generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// known-bug: #102682
// edition: 2021

#![allow(incomplete_features)]

trait MyTrait<T, U> {
async fn foo(&self) -> &(T, U);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/async-await/in-trait/async-generics.stderr
Original file line number Diff line number Diff line change
@@ -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);
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^
Expand All @@ -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);
| ^^^^^^^^^^^^^-^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/async-await/in-trait/async-lifetimes-and-bounds.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// check-pass
// edition: 2021

#![allow(incomplete_features)]

use std::fmt::Debug;

trait MyTrait<'a, 'b, T> {
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/async-await/in-trait/async-lifetimes.rs
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/async-await/in-trait/async-recursive-generic.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// edition: 2021

#![allow(incomplete_features)]

trait MyTrait<T> {
async fn foo_recursive(&self, n: usize) -> T;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/async-await/in-trait/async-recursive.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// edition: 2021

#![allow(incomplete_features)]

trait MyTrait {
async fn foo_recursive(&self, n: usize) -> i32;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/async-await/in-trait/async-recursive.stderr
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/async-await/in-trait/early-bound-1.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// check-pass
// edition:2021

#![allow(incomplete_features)]

pub trait Foo {
#[allow(async_fn_in_trait)]
async fn foo(&mut self);
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/impl-trait/in-trait/deep-match.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(incomplete_features)]

struct Wrapper<T>(T);

trait Foo {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/impl-trait/in-trait/deep-match.stderr
Original file line number Diff line number Diff line change
@@ -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 {
| ^^^
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/impl-trait/in-trait/default-body-type-err.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(incomplete_features)]

use std::ops::Deref;

pub trait Foo {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/impl-trait/in-trait/default-body-type-err.stderr
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/impl-trait/in-trait/doesnt-satisfy.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(incomplete_features)]

trait Foo {
fn bar() -> impl std::fmt::Display;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/impl-trait/in-trait/doesnt-satisfy.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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
|
= 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}`
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/impl-trait/in-trait/generics-mismatch.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(incomplete_features)]

struct U;

trait Foo {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/impl-trait/in-trait/generics-mismatch.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/impl-trait/in-trait/issue-102140.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(incomplete_features)]

trait Marker {}
impl Marker for u32 {}

Expand Down
6 changes: 3 additions & 3 deletions tests/ui/impl-trait/in-trait/issue-102140.stderr
Original file line number Diff line number Diff line change
@@ -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`
Expand All @@ -13,15 +13,15 @@ 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`
|
= 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`
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/impl-trait/in-trait/issue-102571.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(incomplete_features)]

use std::fmt::Display;
use std::ops::Deref;

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/impl-trait/in-trait/issue-102571.stderr
Original file line number Diff line number Diff line change
@@ -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>`
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/impl-trait/in-trait/object-safety.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(incomplete_features)]

use std::fmt::Debug;

trait Foo {
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/impl-trait/in-trait/object-safety.stderr
Original file line number Diff line number Diff line change
@@ -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...
Expand All @@ -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...
Expand All @@ -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...
Expand All @@ -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...
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(incomplete_features)]

use std::fmt::Display;

trait Foo {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(incomplete_features)]

struct S;

trait Foo {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4723ca3

Please sign in to comment.