-
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 #114914 - compiler-errors:deduce-tait-in-future-output,…
… r=lcnr Normalize return type of `deduce_future_output_from_obligations` Fixes #114909 Also confirmed to fix #114727 manually Now that we have weak/lazy type aliases, we need to normalize those in future signatures to ensure that `replace_opaque_types_with_inference_vars` actually sees TAITs behind them. This isn't needed in the new solver, but added a test to make sure it doesn't regress there either. r? types cc `@oli-obk` (who's gone, worst case can delay this PR until he's back)
- Loading branch information
Showing
2 changed files
with
25 additions
and
7 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
19 changes: 19 additions & 0 deletions
19
tests/ui/async-await/normalize-output-in-signature-deduction.rs
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,19 @@ | ||
// edition:2021 | ||
// revisions: current next | ||
//[next] compile-flags: -Ztrait-solver=next | ||
// check-pass | ||
|
||
#![feature(type_alias_impl_trait)] | ||
|
||
struct Foo; | ||
|
||
impl Trait for Foo {} | ||
pub trait Trait {} | ||
|
||
pub type TAIT<T> = impl Trait; | ||
|
||
async fn foo<T>() -> TAIT<T> { | ||
Foo | ||
} | ||
|
||
fn main() {} |