-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #112652 - oli-obk:tait_only_in_sig, r=compiler-errors
Require TAITs to be mentioned in the signatures of functions that register hidden types for them r? `@lcnr` `@compiler-errors` This implements the lang team decision from [the TAIT design meeting](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/design.20meeting.202023-05-31.20TAITs/near/362518164).
- Loading branch information
Showing
76 changed files
with
781 additions
and
189 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
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
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
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
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,23 @@ | ||
//! This test is reporting the wrong error. We need | ||
//! more inherent associated type tests that use opaque types | ||
//! in general. Some variant of this test should compile successfully. | ||
// known-bug: unknown | ||
// edition:2018 | ||
|
||
#![feature(impl_trait_in_assoc_type, inherent_associated_types)] | ||
#![allow(incomplete_features)] | ||
|
||
use std::future::Future; | ||
|
||
struct Foo<'a>(&'a mut ()); | ||
|
||
impl Foo<'_> { | ||
type Fut<'a> = impl Future<Output = ()>; | ||
//^ ERROR: the type `&mut ()` does not fulfill the required lifetime | ||
|
||
fn make_fut<'a>(&'a self) -> Self::Fut<'a> { | ||
async { () } | ||
} | ||
} | ||
|
||
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,22 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-90014-tait.rs:19:9 | ||
| | ||
LL | type Fut<'a> = impl Future<Output = ()>; | ||
| ------------------------ the expected future | ||
... | ||
LL | fn make_fut<'a>(&'a self) -> Self::Fut<'a> { | ||
| ------------- expected `Foo<'_>::Fut<'a>` because of return type | ||
LL | async { () } | ||
| ^^^^^^^^^^^^ expected future, found `async` block | ||
| | ||
= note: expected opaque type `Foo<'_>::Fut<'a>` | ||
found `async` block `[async block@$DIR/issue-90014-tait.rs:19:9: 19:21]` | ||
note: this item must have the opaque type in its signature in order to be able to register hidden types | ||
--> $DIR/issue-90014-tait.rs:18:8 | ||
| | ||
LL | fn make_fut<'a>(&'a self) -> Self::Fut<'a> { | ||
| ^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
Oops, something went wrong.