about summary refs log tree commit diff
path: root/tests/ui/async-await/inference_var_self_argument.rs
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-01-17 14:52:38 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-01-17 16:27:57 +0000
commitf1ef930c9d06ebd8a3839346b493f49d40fa69e5 (patch)
tree3fea2526a98827c8d70b91437e297e718c607676 /tests/ui/async-await/inference_var_self_argument.rs
parent25b706cde3e8e0c2d63831e12b57bd187e9b66fe (diff)
downloadrust-f1ef930c9d06ebd8a3839346b493f49d40fa69e5.tar.gz
rust-f1ef930c9d06ebd8a3839346b493f49d40fa69e5.zip
Don't ICE when deducing future output if other errors already occurred
Diffstat (limited to 'tests/ui/async-await/inference_var_self_argument.rs')
-rw-r--r--tests/ui/async-await/inference_var_self_argument.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/async-await/inference_var_self_argument.rs b/tests/ui/async-await/inference_var_self_argument.rs
new file mode 100644
index 00000000000..fd8482f86b4
--- /dev/null
+++ b/tests/ui/async-await/inference_var_self_argument.rs
@@ -0,0 +1,12 @@
+//! This is a regression test for an ICE.
+// edition: 2021
+
+trait Foo {
+    async fn foo(self: &dyn Foo) {
+        //~^ ERROR: `Foo` cannot be made into an object
+        //~| ERROR invalid `self` parameter type: &dyn Foo
+        todo!()
+    }
+}
+
+fn main() {}