Mark some tests as known-bugs and add the test case from the corresponding issue

This commit is contained in:
Oli Scherer 2024-03-14 12:16:51 +00:00
parent 7cfa521931
commit cd9453c637
11 changed files with 78 additions and 24 deletions

View File

@ -4132,7 +4132,6 @@ ui/type-alias-impl-trait/issue-52843.rs
ui/type-alias-impl-trait/issue-53092-2.rs
ui/type-alias-impl-trait/issue-53092.rs
ui/type-alias-impl-trait/issue-53096.rs
ui/type-alias-impl-trait/issue-53398-cyclic-types.rs
ui/type-alias-impl-trait/issue-53598.rs
ui/type-alias-impl-trait/issue-53678-coroutine-and-const-fn.rs
ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs

View File

@ -1,10 +0,0 @@
#![feature(type_alias_impl_trait)]
type Foo = impl Fn() -> Foo;
fn foo() -> Foo {
//~^ ERROR: overflow
foo
}
fn main() {}

View File

@ -1,9 +0,0 @@
error[E0275]: overflow evaluating the requirement `<fn() -> Foo {foo} as FnOnce<()>>::Output == Foo`
--> $DIR/issue-53398-cyclic-types.rs:5:13
|
LL | fn foo() -> Foo {
| ^^^
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0275`.

View File

@ -1,9 +1,9 @@
#![feature(type_alias_impl_trait)]
//@ known-bug: #109268
type Foo = impl Fn() -> Foo;
fn crash(x: Foo) -> Foo {
//~^ ERROR: overflow
x
}

View File

@ -1,5 +1,5 @@
error[E0275]: overflow evaluating the requirement `<Foo as FnOnce<()>>::Output == Foo`
--> $DIR/type-alias-impl-trait-with-cycle-error.rs:5:21
--> $DIR/type-alias-impl-trait-with-cycle-error-1.rs:6:21
|
LL | fn crash(x: Foo) -> Foo {
| ^^^

View File

@ -1,4 +1,5 @@
#![feature(type_alias_impl_trait)]
//@ known-bug: #109268
pub trait Bar<T> {
type Item;
@ -7,7 +8,6 @@ pub trait Bar<T> {
type Foo = impl Bar<Foo, Item = Foo>;
fn crash(x: Foo) -> Foo {
//~^ ERROR: overflow
x
}

View File

@ -1,5 +1,5 @@
error[E0275]: overflow evaluating the requirement `<Foo as Bar<Foo>>::Item == Foo`
--> $DIR/type-alias-impl-trait-with-cycle-error2.rs:9:21
--> $DIR/type-alias-impl-trait-with-cycle-error-2.rs:10:21
|
LL | fn crash(x: Foo) -> Foo {
| ^^^

View File

@ -0,0 +1,10 @@
#![feature(type_alias_impl_trait)]
//@ known-bug: #109268
type Foo<'a> = impl Fn() -> Foo<'a>;
fn crash<'a>(_: &'a (), x: Foo<'a>) -> Foo<'a> {
x
}
fn main() {}

View File

@ -0,0 +1,9 @@
error[E0275]: overflow evaluating the requirement `<Foo<'_> as FnOnce<()>>::Output == Foo<'a>`
--> $DIR/type-alias-impl-trait-with-cycle-error-3.rs:6:40
|
LL | fn crash<'a>(_: &'a (), x: Foo<'a>) -> Foo<'a> {
| ^^^^^^^
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0275`.

View File

@ -0,0 +1,16 @@
#![feature(type_alias_impl_trait)]
//@ known-bug: trait-system-refactor-initiative#43
trait Id {
type Assoc;
}
impl<T> Id for T {
type Assoc = T;
}
type Ty
where
Ty: Id<Assoc = Ty>,
= impl Sized;
fn define() -> Ty {}
fn main() {}

View File

@ -0,0 +1,39 @@
error[E0275]: overflow evaluating the requirement `Ty: Id`
--> $DIR/type-alias-impl-trait-with-cycle-error-4.rs:11:1
|
LL | type Ty
| ^^^^^^^
|
note: required by a bound on the type alias `Ty`
--> $DIR/type-alias-impl-trait-with-cycle-error-4.rs:13:9
|
LL | Ty: Id<Assoc = Ty>,
| ^^^^^^^^^^^^^^ required by this bound
error[E0275]: overflow evaluating the requirement `Ty: Id`
--> $DIR/type-alias-impl-trait-with-cycle-error-4.rs:15:19
|
LL | fn define() -> Ty {}
| ^^
|
note: required by a bound on the type alias `Ty`
--> $DIR/type-alias-impl-trait-with-cycle-error-4.rs:13:9
|
LL | Ty: Id<Assoc = Ty>,
| ^^^^^^^^^^^^^^ required by this bound
error[E0275]: overflow evaluating the requirement `Ty: Id`
--> $DIR/type-alias-impl-trait-with-cycle-error-4.rs:15:16
|
LL | fn define() -> Ty {}
| ^^
|
note: required by a bound on the type alias `Ty`
--> $DIR/type-alias-impl-trait-with-cycle-error-4.rs:13:9
|
LL | Ty: Id<Assoc = Ty>,
| ^^^^^^^^^^^^^^ required by this bound
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0275`.