bless tests

This commit is contained in:
Michael Goulet 2022-08-10 16:47:26 +00:00
parent 8ec6c84bb3
commit 43ad19b250
11 changed files with 23 additions and 70 deletions

View File

@ -1,7 +1,4 @@
// check-fail
// known-bug: #80626
// This should pass, but it requires `Sized` to be coinductive.
// check-pass
trait Allocator {
type Allocated<T>;
@ -9,7 +6,7 @@ trait Allocator {
enum LinkedList<A: Allocator> {
Head,
Next(A::Allocated<Self>)
Next(A::Allocated<Self>),
}
fn main() {}

View File

@ -1,15 +0,0 @@
error[E0275]: overflow evaluating the requirement `LinkedList<A>: Sized`
--> $DIR/issue-80626.rs:12:10
|
LL | Next(A::Allocated<Self>)
| ^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `Allocator::Allocated`
--> $DIR/issue-80626.rs:7:20
|
LL | type Allocated<T>;
| ^ required by this bound in `Allocator::Allocated`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0275`.

View File

@ -1,3 +1,5 @@
// check-pass
trait PointerFamily {
type Pointer<T>;
}
@ -10,11 +12,13 @@ impl PointerFamily for RcFamily {
}
#[allow(dead_code)]
enum Node<T, P: PointerFamily> where P::Pointer<Node<T, P>>: Sized {
enum Node<T, P: PointerFamily>
where
P::Pointer<Node<T, P>>: Sized,
{
Cons(P::Pointer<Node<T, P>>),
}
fn main() {
let _list: <RcFamily as PointerFamily>::Pointer<Node<i32, RcFamily>>;
//~^ ERROR overflow evaluating the requirement `Node<i32, RcFamily>: Sized`
}

View File

@ -1,9 +0,0 @@
error[E0275]: overflow evaluating the requirement `Node<i32, RcFamily>: Sized`
--> $DIR/issue-87750.rs:18:16
|
LL | let _list: <RcFamily as PointerFamily>::Pointer<Node<i32, RcFamily>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0275`.

View File

@ -21,6 +21,7 @@ impl<T> Foo for Number<T> {
// ```
// which it is :)
type Item = [T] where [T]: Sized;
//~^ ERROR overflow evaluating the requirement `<Number<T> as Foo>::Item == _`
}
struct OnlySized<T> where T: Sized { f: T }
@ -40,7 +41,6 @@ impl<T> Bar for T where T: Foo {
// can use the bound on `Foo::Item` for this, but that requires
// `wf(<T as Foo>::Item)`, which is an invalid cycle.
type Assoc = OnlySized<<T as Foo>::Item>;
//~^ ERROR overflow evaluating the requirement `<T as Foo>::Item: Sized`
}
fn foo<T: Print>() {

View File

@ -1,14 +1,8 @@
error[E0275]: overflow evaluating the requirement `<T as Foo>::Item: Sized`
--> $DIR/projection-bound-cycle-generic.rs:42:18
error[E0275]: overflow evaluating the requirement `<Number<T> as Foo>::Item == _`
--> $DIR/projection-bound-cycle-generic.rs:23:5
|
LL | type Assoc = OnlySized<<T as Foo>::Item>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `OnlySized`
--> $DIR/projection-bound-cycle-generic.rs:26:18
|
LL | struct OnlySized<T> where T: Sized { f: T }
| ^ required by this bound in `OnlySized`
LL | type Item = [T] where [T]: Sized;
| ^^^^^^^^^
error: aborting due to previous error

View File

@ -24,6 +24,7 @@ impl Foo for Number {
// ```
// which it is :)
type Item = str where str: Sized;
//~^ ERROR overflow evaluating the requirement `<Number as Foo>::Item == _`
}
struct OnlySized<T> where T: Sized { f: T }
@ -43,7 +44,6 @@ impl<T> Bar for T where T: Foo {
// can use the bound on `Foo::Item` for this, but that requires
// `wf(<T as Foo>::Item)`, which is an invalid cycle.
type Assoc = OnlySized<<T as Foo>::Item>;
//~^ ERROR overflow evaluating the requirement `<T as Foo>::Item: Sized`
}
fn foo<T: Print>() {

View File

@ -1,14 +1,8 @@
error[E0275]: overflow evaluating the requirement `<T as Foo>::Item: Sized`
--> $DIR/projection-bound-cycle.rs:45:18
error[E0275]: overflow evaluating the requirement `<Number as Foo>::Item == _`
--> $DIR/projection-bound-cycle.rs:26:5
|
LL | type Assoc = OnlySized<<T as Foo>::Item>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `OnlySized`
--> $DIR/projection-bound-cycle.rs:29:18
|
LL | struct OnlySized<T> where T: Sized { f: T }
| ^ required by this bound in `OnlySized`
LL | type Item = str where str: Sized;
| ^^^^^^^^^
error: aborting due to previous error

View File

@ -1,7 +1,8 @@
error[E0391]: cycle detected when computing layout of `Foo<()>`
|
= note: ...which requires computing layout of `<() as A>::Assoc`...
= note: ...which again requires computing layout of `Foo<()>`, completing the cycle
note: cycle used when optimizing MIR for `main`
note: cycle used when elaborating drops for `main`
--> $DIR/recursive-type-2.rs:11:1
|
LL | fn main() {

View File

@ -1,10 +1,12 @@
// check-pass
trait A<Y, N> {
type B;
}
type MaybeBox<T> = <T as A<T, Box<T>>>::B;
struct P {
t: MaybeBox<P>, //~ ERROR: overflow evaluating the requirement `P: Sized`
t: MaybeBox<P>,
}
impl<Y, N> A<Y, N> for P {

View File

@ -1,15 +0,0 @@
error[E0275]: overflow evaluating the requirement `P: Sized`
--> $DIR/issue-82830.rs:7:8
|
LL | t: MaybeBox<P>,
| ^^^^^^^^^^^
|
note: required for `P` to implement `A<P, Box<P>>`
--> $DIR/issue-82830.rs:10:12
|
LL | impl<Y, N> A<Y, N> for P {
| ^^^^^^^ ^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0275`.