Fix known-bug, silence ICE stderr
This commit is contained in:
parent
4c83bd03a9
commit
3eecdd10a2
9 changed files with 19 additions and 32 deletions
|
@ -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([^)]*)" -> "..."
|
||||
|
|
|
@ -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<const A: usize>() -> [(); A - 0] {
|
||||
//~^ WARN function cannot
|
||||
Self::foo()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ warning: function cannot return without recursing
|
|||
|
|
||||
LL | pub fn foo<const A: usize>() -> [(); A - 0] {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
|
||||
LL |
|
||||
LL | Self::foo()
|
||||
| ----------- recursive call site
|
||||
|
|
||||
|
|
|
@ -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::<WindowsMut<'_>>(windows);
|
||||
}
|
||||
|
|
|
@ -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::<WindowsMut<'_>>(windows);
|
||||
| -------------------------------------- argument requires that borrow lasts for `'static`
|
||||
LL | }
|
||||
|
|
|
@ -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<I: LendingIterator> LendingIterator for &mut I {
|
||||
|
|
|
@ -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<I: FutureIterator>() -> impl Send {
|
||||
async { // a generator checked for autotrait impl `Send`
|
||||
//~^ lifetime bound not satisfied
|
||||
let x = None::<I::Future<'_, '_>>; // a type referencing GAT
|
||||
async {}.await; // a yield point
|
||||
}
|
||||
|
@ -21,16 +20,13 @@ fn call<I: FutureIterator>() -> 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::<I::Future<'a, 'b>>; // 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::<I::Future<'a, 'b>>; // a type referencing GAT
|
||||
async {}.await; // a yield point
|
||||
}
|
||||
|
|
|
@ -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::<I::Future<'_, '_>>; // 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::<I::Future<'_, '_>>; // 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::<I::Future<'_, '_>>; // a type referencing GAT
|
||||
| ^^
|
||||
= note: this is a known limitation that will be removed in the future (see issue #100013 <https://github.com/rust-lang/rust/issues/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::<I::Future<'a, 'b>>; // 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 <https://github.com/rust-lang/rust/issues/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::<I::Future<'a, 'b>>; // 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::<I::Future<'a, 'b>>; // 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 {
|
||||
| ^^
|
||||
|
|
|
@ -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<T>: Sized {
|
|||
|
||||
arg = self;
|
||||
ret = <Self::Base as Functor>::fmap(arg);
|
||||
//~^ type annotations needed
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue