]> git.lizzy.rs Git - rust.git/commitdiff
Add more realistic example of async error
authorJoshua Nelson <jyn514@gmail.com>
Tue, 4 Aug 2020 01:21:33 +0000 (21:21 -0400)
committerJoshua Nelson <jyn514@gmail.com>
Tue, 4 Aug 2020 01:26:59 +0000 (21:26 -0400)
src/test/rustdoc-ui/error-in-impl-trait/realistic-async.rs [new file with mode: 0644]

diff --git a/src/test/rustdoc-ui/error-in-impl-trait/realistic-async.rs b/src/test/rustdoc-ui/error-in-impl-trait/realistic-async.rs
new file mode 100644 (file)
index 0000000..248575d
--- /dev/null
@@ -0,0 +1,28 @@
+// edition:2018
+// check-pass
+
+mod windows {
+    pub trait WinFoo {
+        fn foo(&self) {}
+    }
+
+    impl WinFoo for () {}
+}
+
+#[cfg(any(windows, doc))]
+use windows::*;
+
+mod unix {
+    pub trait UnixFoo {
+        fn foo(&self) {}
+    }
+
+    impl UnixFoo for () {}
+}
+
+#[cfg(any(unix, doc))]
+use unix::*;
+
+async fn bar() {
+    ().foo()
+}