diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2023-04-03 20:29:41 +0200 |
|---|---|---|
| committer | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2023-04-03 20:45:02 +0200 |
| commit | 9e579cc10c32945cdde6fa1fb474005d31b8c2cf (patch) | |
| tree | bae70e283c06ae4052c539002f35df5a8a227596 /tests | |
| parent | 17675855094906ba90aca2f119be8fb7afc4d456 (diff) | |
| download | rust-9e579cc10c32945cdde6fa1fb474005d31b8c2cf.tar.gz rust-9e579cc10c32945cdde6fa1fb474005d31b8c2cf.zip | |
Add test
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/async-await/missed-capture-issue-107414.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/async-await/missed-capture-issue-107414.rs b/tests/ui/async-await/missed-capture-issue-107414.rs new file mode 100644 index 00000000000..0ab4f5ade98 --- /dev/null +++ b/tests/ui/async-await/missed-capture-issue-107414.rs @@ -0,0 +1,24 @@ +// check-pass +// edition:2018 + +fn main() {} + +struct StructA {} +struct StructB {} + +impl StructA { + fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool { + true + } +} + +async fn get_struct_a_async() -> StructA { + StructA {} +} + +async fn ice() { + match Some(StructB {}) { + Some(struct_b) if get_struct_a_async().await.fn_taking_struct_b(&struct_b) => {} + _ => {} + } +} |
