summaryrefslogtreecommitdiffstats
path: root/third_party/rust/async-trait/tests/ui/must-use.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/async-trait/tests/ui/must-use.rs')
-rw-r--r--third_party/rust/async-trait/tests/ui/must-use.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/third_party/rust/async-trait/tests/ui/must-use.rs b/third_party/rust/async-trait/tests/ui/must-use.rs
new file mode 100644
index 0000000000..7ad0d9bf33
--- /dev/null
+++ b/third_party/rust/async-trait/tests/ui/must-use.rs
@@ -0,0 +1,21 @@
+#![deny(unused_must_use)]
+
+use async_trait::async_trait;
+
+#[async_trait]
+trait Interface {
+ async fn f(&self);
+}
+
+struct Thing;
+
+#[async_trait]
+impl Interface for Thing {
+ async fn f(&self) {}
+}
+
+pub async fn f() {
+ Thing.f();
+}
+
+fn main() {}