-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix outlives suggestion for GAT in RPITIT
- Loading branch information
1 parent
64368d0
commit 17ec3cd
Showing
3 changed files
with
68 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// edition: 2021 | ||
|
||
use std::future::Future; | ||
|
||
trait Trait { | ||
type Gat<'a>; | ||
//~^ ERROR missing required bound on `Gat` | ||
async fn foo(&self) -> Self::Gat<'_>; | ||
} | ||
|
||
trait Trait2 { | ||
type Gat<'a>; | ||
//~^ ERROR missing required bound on `Gat` | ||
async fn foo(&self) -> impl Future<Output = Self::Gat<'_>>; | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
error: missing required bound on `Gat` | ||
--> $DIR/gat-outlives.rs:6:5 | ||
| | ||
LL | type Gat<'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 `Gat` | ||
--> $DIR/gat-outlives.rs:12:5 | ||
| | ||
LL | type Gat<'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: aborting due to 2 previous errors | ||
|