From 3eecdd10a2e145c1744592784de41a0d6e7c30a2 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 11 Jan 2023 19:42:27 +0000 Subject: [PATCH] Fix known-bug, silence ICE stderr --- tests/ui/chalkify/bugs/async.rs | 6 ++--- .../ui/const-generics/issues/issue-85031-2.rs | 3 +-- .../issues/issue-85031-2.stderr | 1 - .../bugs/hrtb-implied-1.rs | 3 +-- .../bugs/hrtb-implied-1.stderr | 2 +- .../bugs/hrtb-implied-2.rs | 3 +-- .../bugs/issue-100013.rs | 6 +---- .../bugs/issue-100013.stderr | 24 ++++++++----------- .../bugs/issue-91762.rs | 3 +-- 9 files changed, 19 insertions(+), 32 deletions(-) diff --git a/tests/ui/chalkify/bugs/async.rs b/tests/ui/chalkify/bugs/async.rs index 1c69b07e3d4..3169e4781ee 100644 --- a/tests/ui/chalkify/bugs/async.rs +++ b/tests/ui/chalkify/bugs/async.rs @@ -1,7 +1,7 @@ -// check-fail -// known-bug +// edition:2021 +// known-bug: unknown // unset-rustc-env:RUST_BACKTRACE -// compile-flags:-Z trait-solver=chalk --edition=2021 +// compile-flags:-Z trait-solver=chalk // error-pattern:internal compiler error // failure-status:101 // normalize-stderr-test "DefId([^)]*)" -> "..." diff --git a/tests/ui/const-generics/issues/issue-85031-2.rs b/tests/ui/const-generics/issues/issue-85031-2.rs index 4908fb29692..50dd66da6db 100644 --- a/tests/ui/const-generics/issues/issue-85031-2.rs +++ b/tests/ui/const-generics/issues/issue-85031-2.rs @@ -1,5 +1,5 @@ // check-pass -// known-bug +// known-bug: unknown // This should not compile, as the compiler should not know // `A - 0` is satisfied `?x - 0` if `?x` is inferred to `A`. @@ -10,7 +10,6 @@ pub struct Ref<'a>(&'a i32); impl<'a> Ref<'a> { pub fn foo() -> [(); A - 0] { - //~^ WARN function cannot Self::foo() } } diff --git a/tests/ui/const-generics/issues/issue-85031-2.stderr b/tests/ui/const-generics/issues/issue-85031-2.stderr index fc690576875..896e1c7ea8d 100644 --- a/tests/ui/const-generics/issues/issue-85031-2.stderr +++ b/tests/ui/const-generics/issues/issue-85031-2.stderr @@ -3,7 +3,6 @@ warning: function cannot return without recursing | LL | pub fn foo() -> [(); A - 0] { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing -LL | LL | Self::foo() | ----------- recursive call site | diff --git a/tests/ui/generic-associated-types/bugs/hrtb-implied-1.rs b/tests/ui/generic-associated-types/bugs/hrtb-implied-1.rs index 719d1bd5a4c..5101de19d3c 100644 --- a/tests/ui/generic-associated-types/bugs/hrtb-implied-1.rs +++ b/tests/ui/generic-associated-types/bugs/hrtb-implied-1.rs @@ -1,5 +1,5 @@ // check-fail -// known-bug +// known-bug: unknown // This gives us problems because `for<'a> I::Item<'a>: Debug` should mean "for // all 'a where I::Item<'a> is WF", but really means "for all 'a possible" @@ -29,7 +29,6 @@ where fn main() { let slice = &mut (); - //~^ temporary value dropped while borrowed let windows = WindowsMut { slice }; print_items::>(windows); } diff --git a/tests/ui/generic-associated-types/bugs/hrtb-implied-1.stderr b/tests/ui/generic-associated-types/bugs/hrtb-implied-1.stderr index 1c9abc4e837..362aeae2361 100644 --- a/tests/ui/generic-associated-types/bugs/hrtb-implied-1.stderr +++ b/tests/ui/generic-associated-types/bugs/hrtb-implied-1.stderr @@ -3,7 +3,7 @@ error[E0716]: temporary value dropped while borrowed | LL | let slice = &mut (); | ^^ creates a temporary value which is freed while still in use -... +LL | let windows = WindowsMut { slice }; LL | print_items::>(windows); | -------------------------------------- argument requires that borrow lasts for `'static` LL | } diff --git a/tests/ui/generic-associated-types/bugs/hrtb-implied-2.rs b/tests/ui/generic-associated-types/bugs/hrtb-implied-2.rs index 8e6c5348e71..3174227a7a1 100644 --- a/tests/ui/generic-associated-types/bugs/hrtb-implied-2.rs +++ b/tests/ui/generic-associated-types/bugs/hrtb-implied-2.rs @@ -1,5 +1,5 @@ // check-fail -// known-bug +// known-bug: unknown // This gives us problems because `for<'a> I::Item<'a>: Debug` should mean "for // all 'a where I::Item<'a> is WF", but really means "for all 'a possible" @@ -16,7 +16,6 @@ where { let mut iter2 = Eat(iter, f); let _next = iter2.next(); - //~^ borrowed data escapes true } impl LendingIterator for &mut I { diff --git a/tests/ui/generic-associated-types/bugs/issue-100013.rs b/tests/ui/generic-associated-types/bugs/issue-100013.rs index fc4e47a3ba1..973c548d785 100644 --- a/tests/ui/generic-associated-types/bugs/issue-100013.rs +++ b/tests/ui/generic-associated-types/bugs/issue-100013.rs @@ -1,5 +1,5 @@ // check-fail -// known-bug +// known-bug: unknown // edition: 2021 // We really should accept this, but we need implied bounds between the regions @@ -13,7 +13,6 @@ pub trait FutureIterator { fn call() -> impl Send { async { // a generator checked for autotrait impl `Send` - //~^ lifetime bound not satisfied let x = None::>; // a type referencing GAT async {}.await; // a yield point } @@ -21,16 +20,13 @@ fn call() -> impl Send { fn call2<'a, 'b, I: FutureIterator>() -> impl Send { async { // a generator checked for autotrait impl `Send` - //~^ lifetime bound not satisfied let x = None::>; // a type referencing GAT - //~^ lifetime may not live long enough async {}.await; // a yield point } } fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send { async { // a generator checked for autotrait impl `Send` - //~^ lifetime bound not satisfied let x = None::>; // a type referencing GAT async {}.await; // a yield point } diff --git a/tests/ui/generic-associated-types/bugs/issue-100013.stderr b/tests/ui/generic-associated-types/bugs/issue-100013.stderr index 72ae288dcab..9db124a81e4 100644 --- a/tests/ui/generic-associated-types/bugs/issue-100013.stderr +++ b/tests/ui/generic-associated-types/bugs/issue-100013.stderr @@ -2,77 +2,73 @@ error: lifetime bound not satisfied --> $DIR/issue-100013.rs:15:5 | LL | / async { // a generator checked for autotrait impl `Send` -LL | | LL | | let x = None::>; // a type referencing GAT LL | | async {}.await; // a yield point LL | | } | |_____^ | note: the lifetime defined here... - --> $DIR/issue-100013.rs:17:38 + --> $DIR/issue-100013.rs:16:38 | LL | let x = None::>; // a type referencing GAT | ^^ note: ...must outlive the lifetime defined here - --> $DIR/issue-100013.rs:17:34 + --> $DIR/issue-100013.rs:16:34 | LL | let x = None::>; // a type referencing GAT | ^^ = note: this is a known limitation that will be removed in the future (see issue #100013 for more information) error: lifetime bound not satisfied - --> $DIR/issue-100013.rs:23:5 + --> $DIR/issue-100013.rs:22:5 | LL | / async { // a generator checked for autotrait impl `Send` -LL | | LL | | let x = None::>; // a type referencing GAT -LL | | LL | | async {}.await; // a yield point LL | | } | |_____^ | note: the lifetime defined here... - --> $DIR/issue-100013.rs:22:14 + --> $DIR/issue-100013.rs:21:14 | LL | fn call2<'a, 'b, I: FutureIterator>() -> impl Send { | ^^ note: ...must outlive the lifetime defined here - --> $DIR/issue-100013.rs:22:10 + --> $DIR/issue-100013.rs:21:10 | LL | fn call2<'a, 'b, I: FutureIterator>() -> impl Send { | ^^ = note: this is a known limitation that will be removed in the future (see issue #100013 for more information) error: lifetime may not live long enough - --> $DIR/issue-100013.rs:25:17 + --> $DIR/issue-100013.rs:23:17 | LL | fn call2<'a, 'b, I: FutureIterator>() -> impl Send { | -- -- lifetime `'b` defined here | | | lifetime `'a` defined here -... +LL | async { // a generator checked for autotrait impl `Send` LL | let x = None::>; // a type referencing GAT | ^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'b` | = help: consider adding the following bound: `'a: 'b` error: lifetime bound not satisfied - --> $DIR/issue-100013.rs:32:5 + --> $DIR/issue-100013.rs:29:5 | LL | / async { // a generator checked for autotrait impl `Send` -LL | | LL | | let x = None::>; // a type referencing GAT LL | | async {}.await; // a yield point LL | | } | |_____^ | note: the lifetime defined here... - --> $DIR/issue-100013.rs:31:18 + --> $DIR/issue-100013.rs:28:18 | LL | fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send { | ^^ note: ...must outlive the lifetime defined here - --> $DIR/issue-100013.rs:31:10 + --> $DIR/issue-100013.rs:28:10 | LL | fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send { | ^^ diff --git a/tests/ui/generic-associated-types/bugs/issue-91762.rs b/tests/ui/generic-associated-types/bugs/issue-91762.rs index dec668bec10..8f2cc45509f 100644 --- a/tests/ui/generic-associated-types/bugs/issue-91762.rs +++ b/tests/ui/generic-associated-types/bugs/issue-91762.rs @@ -1,5 +1,5 @@ // check-fail -// known-bug +// known-bug: unknown // We almost certainly want this to pass, but // it's particularly difficult currently, because we need a way of specifying @@ -22,7 +22,6 @@ pub trait FunctorExt: Sized { arg = self; ret = ::fmap(arg); - //~^ type annotations needed } }