-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #123701 - compiler-errors:only-assert-after-checking,…
… r=WaffleLapkin Only assert for child/parent projection compatibility AFTER checking that theyre coming from the same place This assertion doesn't make sense until we check that these captures are actually equivalent. Fixes #123697 <sub>Some days I wonder how I even write code that works...</sub>
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
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
16 changes: 16 additions & 0 deletions
16
tests/ui/async-await/async-closures/different-projection-lengths-for-different-upvars.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,16 @@ | ||
//@ check-pass | ||
//@ edition: 2021 | ||
// issue: rust-lang/rust#123697 | ||
|
||
#![feature(async_closure)] | ||
|
||
struct S { t: i32 } | ||
|
||
fn test(s: &S, t: &i32) { | ||
async || { | ||
println!("{}", s.t); | ||
println!("{}", t); | ||
}; | ||
} | ||
|
||
fn main() {} |