Use known-bug prop for GAT bug tests

This commit is contained in:
Jack Huey 2022-02-12 14:48:07 -05:00
parent 7c6ff4b269
commit e660d52e3d
20 changed files with 32 additions and 27 deletions

View File

@ -1,4 +1,5 @@
// check-fail
// known-bug
// This should pass, but it requires `Sized` to be coinductive.
@ -11,7 +12,6 @@ trait Allocator {
enum LinkedList<A: Allocator> {
Head,
Next(A::Allocated<Self>)
//~^ overflow
}
fn main() {}

View File

@ -1,5 +1,5 @@
error[E0275]: overflow evaluating the requirement `LinkedList<A>: Sized`
--> $DIR/issue-80626.rs:13:10
--> $DIR/issue-80626.rs:14:10
|
LL | Next(A::Allocated<Self>)
| ^^^^^^^^^^^^^^^^^^

View File

@ -1,4 +1,5 @@
// check-fail
// known-bug
// This should pass, but seems to run into a TAIT issue.
@ -20,7 +21,6 @@ trait Yay<AdditionalValue> {
impl<'a> Yay<&'a ()> for () {
type InnerStream<'s> = impl Stream<Item = i32> + 's;
//~^ the type
fn foo<'s>() -> Self::InnerStream<'s> { todo!() }
}

View File

@ -1,11 +1,11 @@
error[E0477]: the type `impl Stream<Item = i32>` does not fulfill the required lifetime
--> $DIR/issue-86218.rs:22:28
--> $DIR/issue-86218.rs:23:28
|
LL | type InnerStream<'s> = impl Stream<Item = i32> + 's;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: type must outlive the lifetime `'s` as defined here as required by this binding
--> $DIR/issue-86218.rs:22:22
--> $DIR/issue-86218.rs:23:22
|
LL | type InnerStream<'s> = impl Stream<Item = i32> + 's;
| ^^

View File

@ -1,4 +1,5 @@
// check-fail
// known-bug
// This should pass, but we need an extension of implied bounds (probably).
@ -23,7 +24,7 @@ fn as_ref2<'a>(&'a self) -> Self::Output<'a> {
#[derive(Debug)]
struct FooRef<'a, U>(&'a [U]);
impl<'b, T, U> AsRef2 for Foo<T> //~ the type parameter
impl<'b, T, U> AsRef2 for Foo<T>
where
// * `for<'b, 'c> T: AsRef2<Output<'b> = &'c [U]>>` does not work
//

View File

@ -1,5 +1,5 @@
error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-87735.rs:26:13
--> $DIR/issue-87735.rs:27:13
|
LL | impl<'b, T, U> AsRef2 for Foo<T>
| ^ unconstrained type parameter

View File

@ -1,4 +1,5 @@
// check-fail
// known-bug
// This should pass, but unnormalized input args aren't treated as implied.
@ -14,7 +15,7 @@ trait MyTrait {
impl MyTrait for Foo {
type Assoc<'a, 'b> where 'b: 'a = u32;
fn do_sth(_: u32) {} //~ lifetime bound
fn do_sth(_: u32) {}
// fn do_sth(_: Self::Assoc<'static, 'static>) {}
// fn do_sth(_: Self::Assoc<'_, '_>) {}
}

View File

@ -1,16 +1,16 @@
error[E0478]: lifetime bound not satisfied
--> $DIR/issue-87748.rs:17:5
--> $DIR/issue-87748.rs:18:5
|
LL | fn do_sth(_: u32) {}
| ^^^^^^^^^^^^^^^^^
|
note: lifetime parameter instantiated with the anonymous lifetime #2 defined here
--> $DIR/issue-87748.rs:17:5
--> $DIR/issue-87748.rs:18:5
|
LL | fn do_sth(_: u32) {}
| ^^^^^^^^^^^^^^^^^
note: but lifetime parameter must outlive the anonymous lifetime #1 defined here
--> $DIR/issue-87748.rs:17:5
--> $DIR/issue-87748.rs:18:5
|
LL | fn do_sth(_: u32) {}
| ^^^^^^^^^^^^^^^^^

View File

@ -1,4 +1,5 @@
// check-fail
// known-bug
// This should pass.
@ -15,7 +16,6 @@ trait Foo {
impl Foo for Bar {
type Ass = Bar;
//~^ overflow
}
fn main() {}

View File

@ -1,5 +1,5 @@
error[E0275]: overflow evaluating the requirement `<Bar as Foo>::Ass == _`
--> $DIR/issue-87755.rs:17:16
--> $DIR/issue-87755.rs:18:16
|
LL | type Ass = Bar;
| ^^^

View File

@ -1,4 +1,5 @@
// check-fail
// known-bug
// This should pass, but using a type alias vs a reference directly
// changes late-bound -> early-bound.
@ -18,7 +19,7 @@ impl Scanner for IdScanner {
type Input<'a> = &'a str;
type Token<'a> = &'a str;
fn scan<'a>(&mut self, s : &'a str) -> &'a str { //~ lifetime parameters
fn scan<'a>(&mut self, s : &'a str) -> &'a str {
s
}
}

View File

@ -1,5 +1,5 @@
error[E0195]: lifetime parameters or bounds on method `scan` do not match the trait declaration
--> $DIR/issue-87803.rs:21:12
--> $DIR/issue-87803.rs:22:12
|
LL | fn scan<'a>(&mut self, i : Self::Input<'a>) -> Self::Token<'a>;
| ---- lifetimes in impl do not match this method in trait

View File

@ -1,4 +1,5 @@
// check-fail
// known-bug
// This should pass, but has a missed normalization due to HRTB.
@ -25,7 +26,6 @@ fn do_something<I: Iterable>(i: I, mut f: impl for<'a> Fn(&mut I::Iterator<'a>))
fn main() {
do_something(SomeImplementation(), |_| ());
do_something(SomeImplementation(), test);
//~^ type mismatch
}
fn test<'a, I: Iterable>(_: &mut I::Iterator<'a>) {}

View File

@ -1,5 +1,5 @@
error[E0631]: type mismatch in function arguments
--> $DIR/issue-88382.rs:27:40
--> $DIR/issue-88382.rs:28:40
|
LL | do_something(SomeImplementation(), test);
| ------------ ^^^^ expected signature of `for<'a> fn(&mut <SomeImplementation as Iterable>::Iterator<'a>) -> _`
@ -10,7 +10,7 @@ LL | fn test<'a, I: Iterable>(_: &mut I::Iterator<'a>) {}
| ------------------------------------------------- found signature of `for<'r> fn(&'r mut std::iter::Empty<usize>) -> _`
|
note: required by a bound in `do_something`
--> $DIR/issue-88382.rs:21:56
--> $DIR/issue-88382.rs:22:56
|
LL | fn do_something<I: Iterable>(i: I, mut f: impl for<'a> Fn(&mut I::Iterator<'a>)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `do_something`

View File

@ -1,4 +1,5 @@
// check-fail
// known-bug
// This should pass, but has a missed normalization due to HRTB.
@ -27,5 +28,4 @@ impl Trait for Foo {
fn main() {
test(Foo);
//~^ the trait bound
}

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `for<'a> <_ as Trait>::Assoc<'a>: Marker` is not satisfied
--> $DIR/issue-88460.rs:29:5
--> $DIR/issue-88460.rs:30:5
|
LL | test(Foo);
| ^^^^ the trait `for<'a> Marker` is not implemented for `<_ as Trait>::Assoc<'a>`
|
note: required by a bound in `test`
--> $DIR/issue-88460.rs:16:27
--> $DIR/issue-88460.rs:17:27
|
LL | fn test<T>(value: T)
| ---- required by a bound in this

View File

@ -1,4 +1,5 @@
// check-fail
// known-bug
// This should pass, but requires more logic.
@ -23,7 +24,7 @@ struct TestB<Q, F>
f: F,
}
impl<'q, Q, I, F> A for TestB<Q, F> //~ the type parameter
impl<'q, Q, I, F> A for TestB<Q, F>
where
Q: A<I<'q> = &'q I>,
F: Fn(I),

View File

@ -1,5 +1,5 @@
error[E0207]: the type parameter `I` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-88526.rs:26:13
--> $DIR/issue-88526.rs:27:13
|
LL | impl<'q, Q, I, F> A for TestB<Q, F>
| ^ unconstrained type parameter

View File

@ -1,5 +1,6 @@
// check-fail
// edition:2021
// known-bug
// This should pass, but seems to run into a TAIT bug.
@ -31,11 +32,11 @@ trait X {
struct Y;
impl X for Y {
type LineStream<'a, Repr> = impl Stream<Item = Repr>; //~ could not find
type LineStream<'a, Repr> = impl Stream<Item = Repr>;
type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>> ;
fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> { //~ type mismatch
fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
async {empty()}
}
}

View File

@ -1,5 +1,5 @@
error[E0271]: type mismatch resolving `<impl Future<Output = [async output]> as Future>::Output == impl Stream<Item = Repr>`
--> $DIR/issue-89008.rs:38:43
--> $DIR/issue-89008.rs:39:43
|
LL | type LineStream<'a, Repr> = impl Stream<Item = Repr>;
| ------------------------ the expected opaque type
@ -11,7 +11,7 @@ LL | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
found struct `Empty<_>`
error: could not find defining uses
--> $DIR/issue-89008.rs:34:33
--> $DIR/issue-89008.rs:35:33
|
LL | type LineStream<'a, Repr> = impl Stream<Item = Repr>;
| ^^^^^^^^^^^^^^^^^^^^^^^^