-
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.
Rollup merge of #116800 - compiler-errors:rpitit-gat-outlives, r=jack…
…h726 Fix implied outlives check for GAT in RPITIT We enforce certain `Self: 'lt` bounds for GATs to save space for more sophisticated implied bounds, but those currently operate on the HIR. Code was easily reworked to operate on def-ids so that we can properly let these suggestions propagate through synthetic associated types like RPITITs and AFITs. r? `@jackh726` or `@aliemjay` Fixes #116789
- Loading branch information
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 | ||
|