1
Fork 0

add test for issue-93278, bless

This commit is contained in:
Michael Goulet 2022-02-08 22:28:00 -08:00
parent 477459795d
commit d8b49f0282
2 changed files with 44 additions and 17 deletions

View file

@ -1,7 +1,5 @@
#![feature(generic_associated_types)] #![feature(generic_associated_types)]
// check-fail
use std::fmt::Debug; use std::fmt::Debug;
// We have a `&'a self`, so we need a `Self: 'a` // We have a `&'a self`, so we need a `Self: 'a`
@ -117,7 +115,6 @@ trait TraitLifetime<'a> {
} }
// Like above, but we have a where clause that can prove what we want // Like above, but we have a where clause that can prove what we want
// FIXME: we require two bounds (`where Self: 'a, Self: 'b`) when we should only require one
trait TraitLifetimeWhere<'a> where Self: 'a { trait TraitLifetimeWhere<'a> where Self: 'a {
type Bar<'b>; type Bar<'b>;
//~^ missing required //~^ missing required
@ -140,11 +137,19 @@ trait NotInReturn {
// We obviously error for `Iterator`, but we should also error for `Item` // We obviously error for `Iterator`, but we should also error for `Item`
trait IterableTwo { trait IterableTwo {
type Item<'a>; type Item<'a>;
//~^ missing required
type Iterator<'a>: Iterator<Item = Self::Item<'a>>; type Iterator<'a>: Iterator<Item = Self::Item<'a>>;
//~^ missing required //~^ missing required
fn iter<'a>(&'a self) -> Self::Iterator<'a>; fn iter<'a>(&'a self) -> Self::Iterator<'a>;
} }
trait IterableTwoWhere {
type Item<'a>;
//~^ missing required
type Iterator<'a>: Iterator<Item = Self::Item<'a>> where Self: 'a;
fn iter<'a>(&'a self) -> Self::Iterator<'a>;
}
// We also should report region outlives clauses. Here, we know that `'y: 'x`, // We also should report region outlives clauses. Here, we know that `'y: 'x`,
// because of `&'x &'y`, so we require that `'b: 'a`. // because of `&'x &'y`, so we require that `'b: 'a`.
trait RegionOutlives { trait RegionOutlives {

View file

@ -1,5 +1,5 @@
error: missing required bound on `Item` error: missing required bound on `Item`
--> $DIR/self-outlives-lint.rs:9:5 --> $DIR/self-outlives-lint.rs:7:5
| |
LL | type Item<'x>; LL | type Item<'x>;
| ^^^^^^^^^^^^^- | ^^^^^^^^^^^^^-
@ -10,7 +10,7 @@ LL | type Item<'x>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out` error: missing required bound on `Out`
--> $DIR/self-outlives-lint.rs:25:5 --> $DIR/self-outlives-lint.rs:23:5
| |
LL | type Out<'x>; LL | type Out<'x>;
| ^^^^^^^^^^^^- | ^^^^^^^^^^^^-
@ -21,7 +21,7 @@ LL | type Out<'x>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out` error: missing required bound on `Out`
--> $DIR/self-outlives-lint.rs:39:5 --> $DIR/self-outlives-lint.rs:37:5
| |
LL | type Out<'x>; LL | type Out<'x>;
| ^^^^^^^^^^^^- | ^^^^^^^^^^^^-
@ -32,7 +32,7 @@ LL | type Out<'x>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bounds on `Out` error: missing required bounds on `Out`
--> $DIR/self-outlives-lint.rs:46:5 --> $DIR/self-outlives-lint.rs:44:5
| |
LL | type Out<'x, 'y>; LL | type Out<'x, 'y>;
| ^^^^^^^^^^^^^^^^- | ^^^^^^^^^^^^^^^^-
@ -43,7 +43,7 @@ LL | type Out<'x, 'y>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out` error: missing required bound on `Out`
--> $DIR/self-outlives-lint.rs:61:5 --> $DIR/self-outlives-lint.rs:59:5
| |
LL | type Out<'x, D>; LL | type Out<'x, D>;
| ^^^^^^^^^^^^^^^- | ^^^^^^^^^^^^^^^-
@ -54,7 +54,7 @@ LL | type Out<'x, D>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out` error: missing required bound on `Out`
--> $DIR/self-outlives-lint.rs:77:5 --> $DIR/self-outlives-lint.rs:75:5
| |
LL | type Out<'x, D>; LL | type Out<'x, D>;
| ^^^^^^^^^^^^^^^- | ^^^^^^^^^^^^^^^-
@ -65,7 +65,7 @@ LL | type Out<'x, D>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out` error: missing required bound on `Out`
--> $DIR/self-outlives-lint.rs:92:5 --> $DIR/self-outlives-lint.rs:90:5
| |
LL | type Out<'x, D>; LL | type Out<'x, D>;
| ^^^^^^^^^^^^^^^- | ^^^^^^^^^^^^^^^-
@ -76,7 +76,7 @@ LL | type Out<'x, D>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bounds on `Bar` error: missing required bounds on `Bar`
--> $DIR/self-outlives-lint.rs:114:5 --> $DIR/self-outlives-lint.rs:112:5
| |
LL | type Bar<'b>; LL | type Bar<'b>;
| ^^^^^^^^^^^^- | ^^^^^^^^^^^^-
@ -87,7 +87,7 @@ LL | type Bar<'b>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Bar` error: missing required bound on `Bar`
--> $DIR/self-outlives-lint.rs:122:5 --> $DIR/self-outlives-lint.rs:119:5
| |
LL | type Bar<'b>; LL | type Bar<'b>;
| ^^^^^^^^^^^^- | ^^^^^^^^^^^^-
@ -98,7 +98,7 @@ LL | type Bar<'b>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Bar` error: missing required bound on `Bar`
--> $DIR/self-outlives-lint.rs:129:5 --> $DIR/self-outlives-lint.rs:126:5
| |
LL | type Bar<'b>; LL | type Bar<'b>;
| ^^^^^^^^^^^^- | ^^^^^^^^^^^^-
@ -108,8 +108,19 @@ LL | type Bar<'b>;
= note: this bound is currently required to ensure that impls have maximum flexibility = note: this bound is currently required to ensure that impls have maximum flexibility
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Item`
--> $DIR/self-outlives-lint.rs:139:5
|
LL | type Item<'a>;
| ^^^^^^^^^^^^^-
| |
| help: add the required where clause: `where Self: 'a`
|
= note: this bound is currently required to ensure that impls have maximum flexibility
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Iterator` error: missing required bound on `Iterator`
--> $DIR/self-outlives-lint.rs:143:5 --> $DIR/self-outlives-lint.rs:141:5
| |
LL | type Iterator<'a>: Iterator<Item = Self::Item<'a>>; LL | type Iterator<'a>: Iterator<Item = Self::Item<'a>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
@ -119,8 +130,19 @@ LL | type Iterator<'a>: Iterator<Item = Self::Item<'a>>;
= note: this bound is currently required to ensure that impls have maximum flexibility = note: this bound is currently required to ensure that impls have maximum flexibility
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Item`
--> $DIR/self-outlives-lint.rs:147:5
|
LL | type Item<'a>;
| ^^^^^^^^^^^^^-
| |
| help: add the required where clause: `where Self: 'a`
|
= note: this bound is currently required to ensure that impls have maximum flexibility
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Bar` error: missing required bound on `Bar`
--> $DIR/self-outlives-lint.rs:151:5 --> $DIR/self-outlives-lint.rs:156:5
| |
LL | type Bar<'a, 'b>; LL | type Bar<'a, 'b>;
| ^^^^^^^^^^^^^^^^- | ^^^^^^^^^^^^^^^^-
@ -131,7 +153,7 @@ LL | type Bar<'a, 'b>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Fut` error: missing required bound on `Fut`
--> $DIR/self-outlives-lint.rs:167:5 --> $DIR/self-outlives-lint.rs:172:5
| |
LL | type Fut<'out>; LL | type Fut<'out>;
| ^^^^^^^^^^^^^^- | ^^^^^^^^^^^^^^-
@ -141,5 +163,5 @@ LL | type Fut<'out>;
= note: this bound is currently required to ensure that impls have maximum flexibility = note: this bound is currently required to ensure that impls have maximum flexibility
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: aborting due to 13 previous errors error: aborting due to 15 previous errors