summaryrefslogtreecommitdiffstats
path: root/third_party/rust/async-trait/tests/ui/arg-implementation-detail.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/async-trait/tests/ui/arg-implementation-detail.rs')
-rw-r--r--third_party/rust/async-trait/tests/ui/arg-implementation-detail.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/third_party/rust/async-trait/tests/ui/arg-implementation-detail.rs b/third_party/rust/async-trait/tests/ui/arg-implementation-detail.rs
new file mode 100644
index 0000000000..b83aa72fcf
--- /dev/null
+++ b/third_party/rust/async-trait/tests/ui/arg-implementation-detail.rs
@@ -0,0 +1,22 @@
+use async_trait::async_trait;
+
+pub struct Struct;
+
+#[async_trait]
+pub trait Trait {
+ async fn f((_a, _b): (Struct, Struct)) {
+ // Expands to something like:
+ //
+ // fn f(__arg0: (Struct, Struct)) -> … {
+ // Box::pin(async move {
+ // let (_a, _b) = __arg0;
+ // …
+ // })
+ // }
+ //
+ // but user's code must not be allowed to name that temporary argument:
+ let _ = __arg0;
+ }
+}
+
+fn main() {}